This related question shows how to build and run a Visual Studio solution from Visual Studio Developer Command Prompt. My question is, is it possible to build and run a Visual Studio solution directly from the regular Windows Command Prompt (cmd.exe)?
Asked
Active
Viewed 1,653 times
4
-
Can you define "run a visual studio solution"? Do you mean Build a visual studio solution? Open it in Visual Studio? or simply run the outcomes of a previous build? – jessehouwing May 23 '15 at 08:56
-
@jessehouwing, I want to build and run the solution without opening the VS IDE, but from the regular command prompt only. Thank you. – Huá dé ní 華得尼 May 23 '15 at 08:58
1 Answers
3
Finally, I found the answer.
- Access VS Developer Command Prompt from regular command prompt.
C:\Users\Hwathanie>cmd.exe /k ""C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat"" x86
- Build the solution.
C:\Users\Hwathanie>msbuild "C:\Users\Hwathanie\Documents\Visual Studio 2013\Projects\MyProject\MyProject.sln" /p:Configuration=Debug
- Run the exe file created.
C:\Users\Hwathanie>"C:\Users\Hwathanie\Documents\Visual Studio 2 013\Projects\MyProject\bin\Debug\MyProject.exe"

Huá dé ní 華得尼
- 1,248
- 1
- 18
- 33