I\'m setting up a new build server to support a migration of our development team from VS2010 to VS2013. We are not migrating our TFS server just yet so the new build server
You should be able to fix the Tools Version by editing the Build Template.
Open the template .xaml file and find the "Run MsBuild for Project" activity. In the properties there is the option to set the tools version. If needed, you could create a template level property to make it easier to configure.
It is due to Vs2012 adding in csproj file this part:
<PropertyGroup>
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
</PropertyGroup>
You can safely remove that part and your solution will build.
You have to ensure that the .proj file begin with <Project ToolsVersion="12"
otherwise the next time you open the project with visual studio 2010, it will add the removed node again.
otherwise if you need to use webdeploy or you use a build server the above solution will not work but you can specify the VisualStudioVersion
property in your build script:
msbuild myproject.csproj /p:VisualStudioVersion=12.0
or edit your build definition:
What you could do is specify the VisualStudioVersion property when running msbuild on the build server
msbuild myproject.csproj /p:VisualStudioVersion=12.0
I ran into a similar issue...and here's why. Starting with VS2013, MSBuild is shipped as part of Visual Studio instead of the .NET Framework. Refer to this msdn blog.
So to resolve my issue [the correct way], I had to use MSBuild from the "C:\Program Files (x86)\MSBuild\12.0\bin\" instead of "C:\Windows\Microsoft.NET\Framework64\v4.0.30319\"