Technology Toolbox

Your technology Sherpa for the Microsoft platform

Jeremy Jameson - Founder and Principal



C++ Compiler in Visual Studio 2010 Must Target .NET Framework 4

This post originally appeared on my MSDN blog:

Since I no longer work for Microsoft, I have copied it here in case that blog ever goes away.

Another "hiccup" this week after upgrading my Team Foundation Server (TFS) 2008 environment to TFS 2010...

This morning I discovered that when you upgrade a managed C++ project from Visual Studio 2008 to Visual Studio 2010, the project is updated automatically to target .NET Framework 4. Unlike most other project types, you can't just quickly change a project setting in order to target an earlier version of the .NET Framework.

Note that you can force a managed C++ project to continue to target one of the older versions of the .NET Framework, as described in the following:

However, you'll need to have Visual Studio 2008 installed on your build server -- or, presumably, you could choose to install the Microsoft Windows SDK for Windows Server 2008 and .NET Framework 3.5 instead (as I described in one of my blog posts last year).

Instead of tweaking the build (and having to re-install the SDK or Visual Studio 2008 on the build server), I chose instead to upgrade the other projects (that reference the managed C++ project) to .NET Framework 4.

As I've mentioned in the past, I'm not doing very much in C++ these days, and my primary objective was to get my "Toolbox" solution to build in my upgraded environment.

For lots more useful information on upgrading C++ projects to Visual Studio 2010, refer to the "Project Upgrade Guide" post referenced above.


No comments posted yet.

Add Comment

Optional, but recommended (especially if you have a Gravatar). Note that your email address will not appear with your comment.
If URL is specified, it will be included as a link with your name.

To prevent spam from being submitted, please select the following fruit: Watermelon

Please add 4 and 4 and type the answer here: