MYHOSPITALNOW.COM

Find Trusted Doctors & Hospitals

Discover healthcare providers, compare hospitals, and explore treatment options worldwide.

Free Treatment Quotes • Doctor Search • Hospital Comparison

Find Healthcare Options

www.myhospitalnow.com

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

If you use Visual Studio’s devenv.exe from a terminal, these switches let you build, clean, run, and troubleshoot solutions without manually driving the IDE. This guide reorganizes the original switch list into practical groups and shows command patterns you can adapt for local scripts and CI tasks.

Originally published on 2009-06-20; fully revised and updated.

devenv.exe command-line switches

Original article: Command line switches of devenv.exe.

How to list switches on your installed version

The most reliable source is the help output from the version installed on your machine:

devenv /?

This is important because switch availability and behavior can differ between Visual Studio releases.

Build and deployment switches

These are the core switches from the original post used for compiling and deployment workflows.

SwitchPurposeDependencyTypical usage
/buildBuild the specified solution configurationNoneStandard compile of a solution configuration
/projectBuild a project instead of the full solutionUse with /buildTarget only one project in a larger solution
/projectconfigSpecify the project configuration to buildUse with /projectBuild a specific project/config pair
/rebuildClean first, then buildNoneForce a full rebuild
/cleanClean build outputsNoneReset binaries/intermediate outputs
/deployBuild specified solution configuration, then deployNoneBuild-and-deploy sequence
/outWrite output to a fileCommonly paired with build-related switchesPersist logs for review
devenv MySolution.sln /build "Release|Any CPU"
devenv MySolution.sln /build "Release|Any CPU" /project MyProject /projectconfig "Release|Any CPU"
devenv MySolution.sln /rebuild "Debug|Any CPU" /out build.log
devenv MySolution.sln /clean "Release|Any CPU"
devenv MySolution.sln /deploy "Release|Any CPU"Code language: JavaScript (javascript)

Run and command-execution switches

These switches control post-build execution and IDE command invocation.

SwitchWhat it doesWhen to use it
/runRun the specified solution configurationStart after build while keeping environment active
/runexitRun specified solution configuration, then terminateNon-interactive execution pattern
/commandExecute an internal command line after startupAutomate an IDE command at launch
devenv MySolution.sln /run "Debug|Any CPU"
devenv MySolution.sln /runexit "Debug|Any CPU"
devenv MySolution.sln /command "File.OpenFile"Code language: JavaScript (javascript)

Switch selection workflow

This quick flow helps choose between the most common build/run switches.

flowchart TD
    A[Start with solution and config] --> B{Need a clean build}
    B -- yes --> C[Use /rebuild]
    B -- no --> D[Use /build]
    C --> E{Run after build}
    D --> E
    E -- no --> F[Optionally add /out for logs]
    E -- yes --> G{Close after run}
    G -- yes --> H[Use /runexit]
    G -- no --> I[Use /run]

IDE behavior and recovery switches

The original post also listed switches focused on UI behavior, localization, and startup stability.

  • /mditabs — use tabbed documents interface.
  • /mdi — use MDI interface.
  • /fn — use specified font name.
  • /fs — use specified font size.
  • /LCID — use specified language ID.
  • /noVSIP — disable VSIP developer license key for VSIP testing.
  • /safemode — load only default environment/services for stability.
  • /resetskippkgs — allow previously skipped VSPackages to load again.

Common command patterns

# Clean, build, and keep a build log
devenv MySolution.sln /clean "Release|Any CPU"
devenv MySolution.sln /build "Release|Any CPU" /out release-build.log

# Build only one project inside the solution
devenv MySolution.sln /build "Release|Any CPU" /project MyProject /projectconfig "Release|Any CPU"

# Run then exit
devenv MySolution.sln /runexit "Debug|Any CPU"

# Troubleshooting startup issues
devenv /safemode
devenv /resetskippkgsCode language: PHP (php)

Common pitfalls

  • Using /project without /build.
  • Using /projectconfig without /project.
  • Forgetting quotes around configuration values like “Release|Any CPU”.
  • Assuming all switches behave identically across Visual Studio versions; verify with devenv /? on the target machine.
  • Running commands where devenv.exe is not on PATH (use a developer shell or full executable path).

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

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

Use this reference to run Visual Studio solution tasks from the command line with devenv.exe. It covers what each switch does, how to combine them safely, and common automation pitfalls.

Read More

NMake for Windows: What It Is, How to Install It, and How to Use It

NMake is Microsoft’s make utility for Windows, commonly used in Visual Studio and older Perl-on-Windows build flows. This guide explains what NMake does, how to set it up (including legacy steps from the original post), and how to run practical build commands.

Read More

Fixing MSB4064 When Building VS2010 Web Solutions with NAnt

If a Visual Studio 2010 web solution builds in the IDE but fails from NAnt with MSB4064/MSB4063, the issue is usually a framework/tooling mismatch. This guide walks through the durable fix and the common missteps.

Read More

Top 10 Integrated Development Environments (IDEs): Features, Pros, Cons & Comparison

Introduction Integrated Development Environments (IDEs) are powerful software applications designed to help developers write, test, debug, and manage code efficiently—all from a single interface. Instead of juggling…

Read More

VISUAL STUDIO PROFILER: THE COMPLETE ONE-STOP TUTORIAL GUIDE

This is a high-quality, long-form document that covers: ✔ What✔ Why✔ When✔ Key Terminology✔ How it works internally✔ How to use it (step-by-step)✔ .NET–specific examples✔ Real-world use…

Read More

Performance Engineering in .NET Lab Setup

.NET 10.0 SDK (v10.0.100) – https://dotnet.microsoft.com/en-us/download/dotnet/thank-you/sdk-10.0.100-windows-x64-installer Visual Studio – https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&channel=Stable&version=VS18&source=VSLandingPage&cid=2500&passive=false Microsoft SQL Server – https://www.microsoft.com/en-in/sql-server/sql-server-downloads Rajesh Kumar I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform…

Read More
Subscribe
Notify of
guest
2 Comments
Newest
Oldest Most Voted
Puja kushwaha
Puja kushwaha
1 month ago

The command-line switches for devenv.exe are useful for automating Visual Studio tasks without relying on manual clicks. Teams can use them to open solutions, run builds, and manage IDE actions in scripts. It is important to check the exit code and build output so automation can detect failures correctly. Using consistent paths and settings also helps scripts run across different machines. These practices make older Visual Studio workflows more repeatable and easier to troubleshoot.

Jason Mitchell
Jason Mitchell
4 months ago

When using devenv.exe commands in automated development workflows, the bigger challenge is not remembering switches but ensuring reliable build execution across different environments. In enterprise setups, command-line builds often run through CI servers where Visual Studio versions, installed extensions, SDK dependencies, and machine configurations can vary. Maintaining a consistent build environment and capturing detailed logs is essential to quickly identify failures that may not appear on a developer machine.
Another important consideration is planning for long-term maintainability. As projects evolve, teams should regularly review whether devenv-based automation is still the right approach or if more lightweight build tools and dedicated build pipelines provide better scalability. Treating build commands as part of the release process with proper version control, validation, and monitoring helps prevent unexpected issues during deployments.

2
0
Would love your thoughts, please comment.x
()
x