0

Background

We have a C++ solution that has been moved from VS2005 to VS2010 where the project files were targeting the .net framework 3.5 but since moving over to VS2010, all of the project files were showing that they were targeting the.net framework 4.0. I have since changed the .vcxproj files manually so that they are targeting the .net framework 3.5, using the method described in the Community Content on this link

The Problem

When I build these project files, manually or via an automated build, the output assemblies are still targeting the .net framework 4.0. I can tell this by using various methods described here. I also know that this is the case as I build and run the installer for this application. Once the application has been installed (which then shows as a service), I try to start the service on the target machine. This service will not start on a machine without the .net framework 4.0 installed. If 4.0 is then installed, the service will start, so this is another test that I can run that shows me that the application has a dependency on .net framework 4.0 which it should not.

The Aim

Ideally, I need to build this application so that the outputs are targeting the .net framework 3.5 instead of 4.0 so that it will actually run as it is supposed to! I have tried to use the 3.5 version of MSBuild as described in one of the answers given for this question here but got the same error that is described underneath that post.

Can anyone help with this? It's proving to be a right pain and I've been banging my head against the wall for over a week trying to get this sorted!

Thanks again in advance

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

1 Answers1

0

Make sure you follow all the instructions as provided in the first link you posted.

For example,

  1. Make sure you have Visual Studio 2008 installed on the build server.

  2. Make sure you also change each project's "Platform Toolset" to v90.

  3. Verify the project's framework version: "In Solution Explorer, right-click your project and then click Properties. In the Property Pages window, in the left pane, expand Common Properties and then select Framework and References. Verify that the new Framework version appears at the top of the right pane."

Rami A.
  • 10,302
  • 4
  • 44
  • 87
  • Thanks for your response, I have gone through your points 1 - I have installed VS2008 followed by SP1 2 - I have changed all of my project toolsets to v90 3 - I have verified all projects are targeting framework 3.5 The issue I am having now when running an automated build for the project is very strange 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. Im trying to find out why this is happening. Any idea? – Vermin Dec 19 '11 at 12:23
  • From this: http://blogs.msdn.com/b/vcblog/archive/2010/03/02/visual-studio-2010-c-project-upgrade-guide.aspx, "Pass /p:TargetFrameworkVersion=v3.5 to MSBuild when building applications" – Rami A. Dec 19 '11 at 14:58
  • Unfortunately, I had that in as an argument for MSBuild already. Any other ideas? – Vermin Dec 19 '11 at 16:21
  • Can you attach\link us to your sample project and code? I can test it on my machine because it may be something with your environment. Does it work on another machine? Try passing the "/verbosity:diag" command line option to get more diagnostic information about the error. – Rami A. Dec 19 '11 at 19:29