tags:

views:

1600

answers:

4

Hi,

I'm trying to run msbuild on a solution that has some C++ code in it. I have the SDK installed but not Visual Studio. I get the following error:

error MSB3411: Could not load the Visual C++ component "VCBuild.exe". If the component is not installed, either 1) install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5, or 2) install Microsoft Visual Studio 2008.

I have vcbuild.exe under C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\vcpackages

How can make MSBuild find it?

+1  A: 

It might be as simple as vcbuild.exe not being in the path. IIRC, at least the visual studio installer doesn't automatically add the command line tools to the system or user path and you have to run vcvars32.bat to set them first before you can kick off the build.

Timo Geusch
It didn't help.I've also tried to add it to the system path manually.
Meidan Alon
I don't remember how exactly I did that, but it really wasn't much more than copying VCBuild.exe to the system. But I think the vcvars32.bat (or however it's called in that version, there are more) had to be called prior to the build, so I added an environment variable pointing to the batch file.
OregonGhost
Thanks. I was running msbuild through TeamCity, so I had to add the path to TC's environment variables.
Meidan Alon
A: 

if you don't have the right version of the SDK installed, you could try MSBuild.exe with the flag /toolsversion:2.0

DesertShadow
+1  A: 

You can download the required windows SDK here: http://www.microsoft.com/downloads/thankyou.aspx?familyId=e6e1c3df-a74f-4207-8586-711ebe331cdc&displayLang=en

pattersonc