Search code examples
x86visual-studio-2017vsixdevenvanycpu

Using devenv.exe from the command line and open a Solution


I've configured my VSIX-Project to run devenv.exe when I press F5. This opens the start page from Visual Studio. In order to test my extension I have to manually open a specific solution.

I tried to run devenv with the argument '/Run PathToSolution.sln' this starts VS with the specified Solution but also runs the startup project. Is there a way to run devenv and open a specific solution?


Solution

  • devenv.exe accepts a solution as an argument. This means that devenv.exe path\to\your\solution.sln will have the effect that you're looking for.

    Adding /Run tells it to load the solution and run it, if you omit it then it will just load the project. For more information, see Devenv Command Line Switches on Microsoft's official documentation.