1

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?

user10101
  • 1,704
  • 2
  • 20
  • 49
  • There is a command line vcvars.bat that should set paths etc correctly - it lives in the hierarchy somewhere (can't remember where off hand) - but if you run the correct version (for the vc++ you want) it should sort that out. If you don't use this, Is it possible that you have the path hard coded in your environment? – Caribou Nov 08 '12 at 14:33
  • I need to use vcvars for VS 2010. This works for the other systems but not mine. And no, I don't have VS 2008 (9.0) path hardcoded in environment. – user10101 Nov 08 '12 at 14:36
  • You'll need to go through the pain of comparing them I suspect... see whats different – Caribou Nov 08 '12 at 14:39

1 Answers1

0

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.

Angew is no longer proud of SO
  • 167,307
  • 17
  • 350
  • 455