4

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)?

Community
  • 1
  • 1
Huá dé ní 華得尼
  • 1,248
  • 1
  • 18
  • 33
  • 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 Answers1

3

Finally, I found the answer.

  1. 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
  1. Build the solution.
C:\Users\Hwathanie>msbuild "C:\Users\Hwathanie\Documents\Visual
Studio 2013\Projects\MyProject\MyProject.sln" /p:Configuration=Debug
  1. 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