Running MSBuild.exe For VS2017

I recently paved and installed Windows 10 on my work laptop.  I decided to not install older versions of Visual Studio and only install VS2017.  In general, that has worked out really well but I have had one nagging issue.

I routinely test my builds by running MSBuild.exe manually from the commandline.  This cuts down the feedback time for results of project changes I make as opposed to waiting for the TFS build or worse the CD pipeline to complete. 

I typically run MSBuild.exe from the following path as it has worked for several versions of VS:

C:\Program Files (x86)\MSBuild\12.0\Bin\MSBuild

The executable still exists with VS2017 as well but it doesn’t work quiet right in all scenarios.  I was getting weird errors about not being able to resolve task dependencies.  In the end I found the new version of MSBuild.exe at the following location which resolved my issues.

C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild

So the moral of the story is use the right version of MSBuild.exe!

4 thoughts on “Running MSBuild.exe For VS2017”

  1. The path is different now because there are “instanced” installations of VS2017 (because you can install multiple copies and name them). This exact same thing frustrated me at first. I think “enterprise” is the “default” instance name if you dont pick anything. Since I’d named mine with my name, I was confused as to why my name showed up in the path!

Leave a Reply to Bert Jackson Cancel reply