devenv.exe is Visual Studio’s command-line entry point for building, cleaning, running, and troubleshooting solutions without manually driving the IDE. This guide is aimed at DevOps and build engineers who need a fast, reliable reference for switch usage, dependencies, and real command examples.
Originally published on 2014-09-29; fully revised and updated.

Check available switches on your machine first
The exact switch set can vary by Visual Studio version. Start every troubleshooting session by checking help output directly from the installed devenv.exe.
devenv /?
Compare core build and execution switches
| Switch | What it does | Typical use |
|---|---|---|
| /build | Builds the specified solution configuration. | Normal CI or local build invocation. |
| /rebuild | Performs a clean, then builds again. | When you suspect stale outputs or dependency drift. |
| /clean | Removes build outputs. | Pre-build cleanup or workspace reset. |
| /deploy | Builds the configuration and then deploys it. | Environments where deployment is configured in the solution. |
| /run | Runs the specified solution configuration. | Launch app from command line without auto-exit. |
| /runexit | Runs the configuration and then terminates. | Automation scenarios where process exit is required. |
Reference switches from the original post
The table below consolidates the switches listed in the original article, including the dependency notes provided there.
| Switch | Purpose | Dependency or note |
|---|---|---|
| /build | Build the specified solution configuration. | Base build command. |
| /project | Build a specific project instead of the full solution. | Original post notes it must be used with /build. |
| /projectconfig | Specify the project configuration to build. | Requires /project. |
| /out | Write build output to a file. | Useful for logs in automation. |
| /rebuild | Build after forcing a clean first. | Equivalent to clean plus build behavior. |
| /clean | Clean build outputs. | Use before deterministic rebuilds. |
| /deploy | Build and then deploy the configuration. | Depends on deployment setup in the solution. |
| /run | Run a solution configuration. | Interactive run behavior. |
| /runexit | Run a solution configuration and terminate. | Better for scripted runs. |
| /command | Execute an internal command after startup. | Used for IDE automation tasks. |
| /mditabs | Use tabbed documents interface. | UI behavior switch. |
| /mdi | Use MDI interface. | UI behavior switch. |
| /fn | Use specified font name. | UI preference switch. |
| /fs | Use specified font size. | UI preference switch. |
| /LCID | Use specified language ID. | Localization-related startup control. |
| /noVSIP | Disable VSIP developer license key for VSIP testing. | Specialized extension/testing scenario. |
| /safemode | Load only default environment and services. | Useful when diagnosing startup instability. |
| /resetskippkgs | Allow previously skipped VSPackages to load again. | Recovery after package load failures. |
Workflow for composing a devenv command
Use this flow to decide which switches to add, especially when narrowing from full-solution builds to project-level builds and log capture.
flowchart TD
A[Choose solution path] --> B{Task type}
B --> C[Build or rebuild]
B --> D[Clean]
B --> E[Run or runexit]
C --> F{Single project only}
F -- yes --> G[Add project]
G --> H[Optional projectconfig]
F -- no --> I[Use solution configuration]
H --> J[Optional out log file]
I --> J
D --> J
E --> J
J --> K[Execute devenv command]
K --> L[Review console or log output]
Practical command examples
Replace file paths and configurations with values from your environment. Quoting configuration values is important when they contain spaces.
devenv MyApp.sln /build "Release|Any CPU"Code language: JavaScript (javascript)
devenv MyApp.sln /build "Release|Any CPU" /project "src\Api\Api.csproj" /projectconfig "Release|Any CPU"Code language: JavaScript (javascript)
devenv MyApp.sln /rebuild "Debug|Any CPU" /out "C:\logs\devenv-build.log"Code language: JavaScript (javascript)
devenv MyApp.sln /clean "Release|Any CPU"Code language: JavaScript (javascript)
devenv MyApp.sln /runexit "Debug|Any CPU"Code language: JavaScript (javascript)
devenv /safemode
Common pitfalls and best practices
- Always verify switch availability with
devenv /?on the target machine, especially across Visual Studio versions. - Follow dependency rules from this reference:
/projectis paired with build operations, and/projectconfigrequires/project. - Use
/outfor reproducible logs in CI jobs and incident reviews. - Use
/safemodeand/resetskippkgswhen diagnosing extension or package loading failures. - Quote solution paths and configuration names to avoid parsing issues in scripts.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals