0

I've never used the command window in Visual Studio but now I'm researching how to use build scripts. I was following this tutorial:

https://msdn.microsoft.com/en-us/library/dd393573.aspx

And I got to the part that said to type in the following in the Command Window:

msbuild buildapp.csproj /t:HelloWorld

So that is what I typed in but I got

msbuild is not valid

Is there another command I need to type in before entering msbuild?

I was able to go to the MSBuild.exe location on my C: drive using the DOS cmd window. I was able to run it there. If that is the answer, then fine. I guess I was thinking it would be able to run it from the Visual Studio Command Window.

webdad3
  • 8,893
  • 30
  • 121
  • 223

3 Answers3

7

I think that you might be using the wrong command window (The one in Visual Studio available by going to View -> Other Windows -> Command Window).

The one you should be using the is the "Developer Command Prompt For VS2015" available as a shortcut in the Start Menu.

Developer Command Prompt For VS2015 screenshot

Nasreddine
  • 36,610
  • 17
  • 75
  • 94
  • Is there anyway to include that prompt inside of Visual Studio itself? Thanks for the answer. I've never used this feature before so this is brand new to me. – webdad3 May 15 '16 at 13:37
  • @webdad3 I answer that in another [question here](http://stackoverflow.com/a/31102479/162671) on SO but Tomer's link works too. – Nasreddine May 15 '16 at 13:48
4

You should run it in the Visual Studio Command Prompt, not in the Command Window in Visual Studio. Notice the note under the "Building the Target" section.

See this superuser question to embed the Command Prompt inside Visual Studio.

Community
  • 1
  • 1
Tomer
  • 1,606
  • 12
  • 18
0

I have rarely used the command window much in visual studio either. It is however used for debugging, not for building visual studio projects.

C.J.
  • 15,637
  • 9
  • 61
  • 77