Wrong version of vcbuild.exe is invoked

2019-07-23 06:43发布

问题:

I have several versions of Visual Studio installed on my system (2005, 2008 and 2010). Also I have a Visual Studio 2005 (8.0) C++ project (vcproj) and solution (sln) associated with it. When I run the following command

msbuild helloworld.sln

the msbuild of version 4.0 is called and then it invokes vcbuild.exe from Visual Studio 9.0 directory. This leads to an error

vcbuild.exe : error VCBLD0010: Project 'XYZ' requires upgrade. Use'vcbuild /upgrade' or 'devenv /upgrade' to upgrade the project.

On the other systems MSBuild 4.0 invokes vcbuild.exe from Visual Studio 8 directory and the project successfully compiles. I cannot figure out why on my system the vcbuild 9.0 invokes instead of 8.0. Do anybody have an idea how to troubleshoot this issue?

回答1:

When running Visual Studio builds from the command line, you should always do that in a command line in which you first ran the vcvarsall.bat from the correct version of VS. Visual Studio installation puts shortcuts to such command lines into the Start menu.