When I use msbuild on a .NET 4.0 project it appears to attempt to build the project with .NET 3.5. I’ve got Visual Studio 2010 installed and the project will build just fine in VS. It seems like an easy problem, but i’m kind of stuck.
So I use the command
msbuild
C:\ProjectPath\ProjectName.csproj
and I get the error.
Build started 9/30/2010 10:19:41 AM.
Project
“C:\ProjectPath\ProjectName.csproj ”
on node 0 (default targets). Project
file contains ToolsVersion=”4.0″,
which is not supported by this version
of MSBuild. Treating the project as if
it had ToolsVersion=”3.5″.
ResolveAssemblyReferences:
Are you sure that MSBuild 4.0 is used? Launching MSBuild from commandline you should see :
If the right version isn’t use, you’ll have to launch MSBuild inside
Visual Studio 2010 Command Promptor put .NET 4 directory (%windir%\Microsoft.NET\Framework\v4.0.30128) in your path.