Find the Best Cosmetic Hospitals

Explore trusted cosmetic hospitals and make a confident choice for your transformation.

“Invest in yourself — your confidence is always worth it.”

Explore Cosmetic Hospitals

Start your journey today — compare options in one place.

devenv.exe Command-Line Switches: Practical Build, Run, and Troubleshooting Reference

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.

command-line-switches-of-devenv-exe

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

SwitchWhat it doesTypical use
/buildBuilds the specified solution configuration.Normal CI or local build invocation.
/rebuildPerforms a clean, then builds again.When you suspect stale outputs or dependency drift.
/cleanRemoves build outputs.Pre-build cleanup or workspace reset.
/deployBuilds the configuration and then deploys it.Environments where deployment is configured in the solution.
/runRuns the specified solution configuration.Launch app from command line without auto-exit.
/runexitRuns 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.

SwitchPurposeDependency or note
/buildBuild the specified solution configuration.Base build command.
/projectBuild a specific project instead of the full solution.Original post notes it must be used with /build.
/projectconfigSpecify the project configuration to build.Requires /project.
/outWrite build output to a file.Useful for logs in automation.
/rebuildBuild after forcing a clean first.Equivalent to clean plus build behavior.
/cleanClean build outputs.Use before deterministic rebuilds.
/deployBuild and then deploy the configuration.Depends on deployment setup in the solution.
/runRun a solution configuration.Interactive run behavior.
/runexitRun a solution configuration and terminate.Better for scripted runs.
/commandExecute an internal command after startup.Used for IDE automation tasks.
/mditabsUse tabbed documents interface.UI behavior switch.
/mdiUse MDI interface.UI behavior switch.
/fnUse specified font name.UI preference switch.
/fsUse specified font size.UI preference switch.
/LCIDUse specified language ID.Localization-related startup control.
/noVSIPDisable VSIP developer license key for VSIP testing.Specialized extension/testing scenario.
/safemodeLoad only default environment and services.Useful when diagnosing startup instability.
/resetskippkgsAllow 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: /project is paired with build operations, and /projectconfig requires /project.
  • Use /out for reproducible logs in CI jobs and incident reviews.
  • Use /safemode and /resetskippkgs when diagnosing extension or package loading failures.
  • Quote solution paths and configuration names to avoid parsing issues in scripts.

Find Trusted Cardiac Hospitals

Compare heart hospitals by city and services — all in one place.

Explore Hospitals
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.

Related Posts

Static vs Dynamic Code Analysis in DevSecOps: Strengths, Limits, and How to Use Both

Static and dynamic code analysis solve different security problems. This guide compares both approaches, explains their trade-offs, and shows how to combine them in a practical CI/CD workflow.

Read More

Static vs Dynamic Code Analysis: Differences, CI/CD Workflow, and Practical Use

Static analysis inspects code without executing it, while dynamic analysis evaluates behavior at runtime. This guide explains the trade-offs, shows how both fit into CI/CD, and provides practical pipeline examples.

Read More

Static vs Dynamic Code Analysis: Differences, Trade-offs, and CI/CD Integration

Static and dynamic code analysis solve different quality and security problems, and neither replaces the other. Learn how they differ, where each fits in DevOps, and how to use both in one CI/CD quality gate.

Read More

Static vs Dynamic Code Analysis: Key Differences and How to Use Both in DevSecOps

Static and dynamic code analysis solve different quality and security problems. This guide explains the differences, trade-offs, and how to combine both in a practical CI/CD workflow.

Read More

Code Coverage vs Test Coverage: What’s Different and How to Use Both in CI

Code coverage and test coverage are often conflated, but they answer different quality questions. This guide explains the distinction, shows how they fit in CI, and provides practical measurement examples.

Read More

Using Gerrit to Strengthen Git Code Review and Automated Code Analysis

Gerrit extends Git with patch-set based code review and CI gating so teams can catch quality issues before merge. This guide shows the workflow, key commands, and practical integration patterns.

Read More