I'm trying to compile windows project from visual studio 2010 (64) on windows 7 in c++ from command line, but I can't find msbuild.exe, where is it?
Asked
Active
Viewed 2.7k times
26
-
Have you read this ? http://stackoverflow.com/questions/1415497/how-do-i-get-msbuild-exe-can-it-build-a-vcproj-when-vs2008-is-not-installed – Anil Jan 04 '12 at 17:12
-
now yes ... but that didn't told me much ... – Ivan Pericic Jan 04 '12 at 17:15
-
Searched my computer, found 13 copies of `msbuild.exe`. They give 11 distinct md5 checksums. I have no idea. – Colonel Panic Feb 20 '15 at 14:07
2 Answers
35
It should be installed as part of .NET 4... so for example, in
c:\Windows\Microsoft.NET\Framework\v4.0.30319
... but if you start a "Visual Studio Command Prompt" instead of just running cmd, it should be in the path already. That's what I'd suggest you do - I always have Visual Studio Command Prompt as a shortcut pinned to my task bar; I have no reason to launch a command prompt which doesn't have the relevant path :)

Jon Skeet
- 1,421,763
- 867
- 9,128
- 9,194
-
1If the Visual Studio command prompt also fails you probably need to remove any quotes surrounding entries in your path - see http://www.blinnov.com/en/2010/06/04/microsoft-was-unexpected-at-this-time/ – morechilli Nov 19 '12 at 08:40
-
Command "MSBuild.exe" is not valid. from Visual Studio 2013 Command Window, file is present at proper location. – Chaitanya Gadkari Sep 21 '15 at 14:03
-
@ChaitanyaGadkari: Not sure what you mean by "is not valid". This should be absolutely fine... – Jon Skeet Sep 21 '15 at 14:04
-
That is the Message i get from command window. (Command "MSBuild.exe" is not valid) – Chaitanya Gadkari Sep 21 '15 at 14:09
-
@ChaitanyaGadkari: Have you tried executing it with an absolute path name? Is everything else working? – Jon Skeet Sep 21 '15 at 14:11
-
yes, I am providing absolute path. Solution(It have two projects if that makes any difference) is working fine as such, but I have not used Command Window before, wanted to explore that. So I have no clue if there is problem with commands. – Chaitanya Gadkari Sep 21 '15 at 14:16
-
Okay, it sounds like something is badly broken, I'm afraid - you're trying to run the 64-bit version on a 32-bit machine, or something like that. You might want to ask a new question with the details in - it's not really suitable for this question, which was just about where msbuild.exe lives. – Jon Skeet Sep 21 '15 at 14:17
-
8
As of 2013 msbuild ships with Visual Studio:
C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild.exe
Before that msbuild shipped with the .NET Framework, up to version 4.5.1:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe

Colonel Panic
- 132,665
- 89
- 401
- 465