I have this error when configuring continuous integration in TFS server, but found the answer already. Maybe this will help others:
The imported project \"C:
<!--<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />-->
Comment above line in .CSproj. Seems like bug with Microsoft which do not remove or comment while updating project from visual studio 2008 to 2010.
Download & install Microsoft Visual Studio 2013 Shell (Isolated) Redistributable Package. Or use the direct link to vs_isoshell.exe. I intend to make an NuGet package for this at a later date.
The advantage I see to this approach is it removes any doubt on copyright issues.
I also met this error on VS2017; then i comment out below two items:
<!--<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /><Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />-->
reopen the solution , the project can be load successfully again. (i don't know how this happen, because this project can be load normally before, maybe i had added some new feature through 'vs-installer.exe' recently)
Here's some PowerShell that fixed this issue for me by adding in the missing reference in MSBuild.exe.config on my Build server. Adjust paths to your VS version / targets path.
[xml]$msbuild_config = Get-Content -Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe.config"
$webApplicationTarget = $msbuild_config.configuration.msbuildToolsets.toolset.property[0].Clone()
$webApplicationTarget.name = "MSWebApplicationTargets"
$webApplicationTarget.value = "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\Microsoft\VisualStudio\v15.0\WebApplications"
$msbuild_config.configuration.msbuildToolsets.toolset.AppendChild($webApplicationTarget)
$msbuild_config.save("C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\MSBuild.exe.config")```
You need to either...
I saw the same error when setting up continuous integration with Jenkins. I was able to add a command-line argument to MSBUILD: /p:VisualStudioVersion=12.0
because I had Visual Studio 2012 installed on my build server.