v11.0\WebApplications\Microsoft.WebApplication.targets was not found when file actually references v10 v11.0\WebApplications\Microsoft.WebApplication.targets was not found when file actually references v10 asp.net asp.net

v11.0\WebApplications\Microsoft.WebApplication.targets was not found when file actually references v10


I ran into the same issue with Visual Studio 2013. It turns out that I was using the old version of MSBuild--the one that ships with the .NET Framework--from the command line. Microsoft is now releasing MSBuild as part of Visual Studio itself and also as a separate installer (http://blogs.msdn.com/b/visualstudio/archive/2013/07/24/msbuild-is-now-part-of-visual-studio.aspx).

The solution was to use the new version of MSBuild.exe located in C:\Program Files (x86)\MSBuild\12.0\Bin. Once I did that, all the targets errors disappeared.

EDIT 1

As mentioned in the comments, each new version of MSBuild brings with it a new directory. For Visual Studio 2015, use C:\Program Files (x86)\MSBuild\14.0\Bin.

EDIT 2

As mentioned in the comments, for Visual Studio 2017, use C:\Program Files (x86)\Microsoft Visual Studio\2017\<Edition>\MSBuild\15.0\Bin\MSBuild.exe.


If you have a build server that does not have VS2012 installed, you can fix this by

a) installing the MSBuild.Microsoft.VisualStudio.Web.targets package to your solution, and

b) replacing this line in the .csproj file:

<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />

With this line pointing to the nuget package

<Import Project="..\packages\MSBuild.Microsoft.VisualStudio.Web.targets.11.0.2.1\tools\VSToolsPath\WebApplications\Microsoft.WebApplication.targets" Condition="true" />

EDIT

As @joedragons points out the version in the updated line should match the nuget package version, i.e. replace targets.11.0.2.1 with targets.x.x.x.x for the current version.


A simple solution to this problem:

Go to the following path:

C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio

You will see the latest version V10.0, v11.0, v12.0 depending on your Visual Studio 2010, 2012 or 2013 install.

Copy WebApplications folder from either of latest version directory and paste to other.

Your issues should be resolved.