0

I am having trouble building C++ projects targeting the .Net Framework v3.5 in VS2010 via automated builds (see my other question here)

While I'm pretty sure that the answer provided to the question is correct, I have hit another problem which is still preventing the builds from working.

I have so far taken the following steps:

  1. Changed the .vcxproj files manually so that they are targeting the .net framework 3.5
  2. Changed each project's "Platform Toolset" to v90
  3. Installed VS2008 SP1 on the build machine
  4. Opened VS2010 command line on the build machine, set TargetFrameworkVersion=v3.5 and started devenv.exe from the commandline.
  5. Pass /p:TargetFrameworkVersion=v3.5 to MSBuild in the workflow for my particular build definition

(steps taken from here)

When i kick off a build for these projects, the build will fall over on the very first project with the following error message:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppBuild.targets (293): Specified platform toolset (v90) requires Visual Studio 2008. Please make sure that Visual Studio 2008 is installed on the machine.

I really am at a loss with this issue. I have no idea why MSBuild would think that VS2008 is not installed when it clearly is. I have tried changing the MSBuild platform from Auto to X86 and that made no difference.

My build machine is running Windows Server 2008 R2 Enterprise (64-bit)

As always, thanks for any help offered

Community
  • 1
  • 1
Vermin
  • 917
  • 2
  • 11
  • 23

2 Answers2

0

Try to pass /p:TargetFrameworkVersion=v3.5;PlatformToolset=v90 to MSBuild in the build definition

Ludwo
  • 6,043
  • 4
  • 32
  • 48
0

Try running with MSBuild 2.0

%WINDIR%\Microsoft.NET\Framework\v2.0.50727\MSBuild.exe

KMoraz
  • 14,004
  • 3
  • 49
  • 82
  • Thanks for the suggestion, but when I change the tool path in the workflow for MSBuild, I get a number of errors concerning unknown switches. I have also previously tried to set the tool path to the 3.5 version of MSBuild but I get an error concerning logging. It would seem that neither MSBuild (2.0 / 3.5) will work due to the switches that are passed to it, however it would appear that these switches are passed in by default via the build process as I cannot see anywhere in the build definition that resemble the switches, nor can I see where the switches come from via the build log – Vermin Jan 06 '12 at 11:42
  • I think the manual changes to vcxproj files are the source of the problem. You should take a step back and make sure the C++ projects compile with no issues via the command line before automating it in TFS. – KMoraz Jan 09 '12 at 08:08