Wrong MSBuild Being Called

873 Views Asked by At

Whenever I try to run MSBuild I get the following:

Microsoft (R) Build Engine Version 2.0.50727.4927
[Microsoft .NET Framework, Version 2.0.50727.4927]
Copyright (C) Microsoft Corporation 2005. All rights reserved.

However, the solutions I'm trying to build produce an error because the .NET 2.0 version of MSBuild is being called instead of the 3.5 or 4.0.

How and where do I manually change the MSBuild PATH and/or Environment so it calls the right version and not the 2.0 version.

1

There are 1 best solutions below

0
On

Typing where msbuild.exe at the command prompt will tell you the location of the executable found in the path.

When starting a Visual Studio Developer Command Prompt for the VS version you are using (presuming you have multiple versions installed) from the start menu, it will automatically set environment variables and the path to the correct locations. Running MSBuild from there should resolve to the correct version.