RSS

Project file contains ToolsVersion “4.0”, which is not supported by this version of MSBuild

14 Sep

Recently I came across this error when calling MSBuild from the command line and building a project which I thought was targeted at framework 3.5.  So why was it trying to reference .NET framework tools version 4.0

Well the answer was that I developed the project in VS2010 but targeted framework 3.5.  When a project is developed in VS2010 the project file is created with a default ToolsVersion reference to 4.0.

e.g.

Open the csproj file and right up the top you will notice something like

<Project ToolsVersion=”4.0″ DefaultTargets=”Build” xmlns=”http://schemas.microsoft.com/developer/msbuild/2003“>

To remove the warning message, just edit the toolsversion to be the version of the framework you are targeting e.g. 3.5

 

Advertisements
 
1 Comment

Posted by on September 14, 2011 in Knowledge Base

 

One response to “Project file contains ToolsVersion “4.0”, which is not supported by this version of MSBuild

  1. Vern

    May 9, 2012 at 9:51 pm

    Thanks 🙂

     

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: