I had a similar problem after upgrading from Visual Studio 2015 to 2017. When I try to download a web application project, it gives me an error message:
The imported project "C: \ Program Files (x86) \ Microsoft Visual Studio \ 2017 \ Enterprise \ MSBuild \ Microsoft \ VisualStudio \ v14.0 \ WebApplications \ Microsoft.WebApplication.targets" was not found. Also tried to find "WebApplications \ Microsoft.WebApplication.targets" in the backup search paths for $ (VSToolsPath) - "C: \ Program Files (x86) \ MSBuild \ Microsoft \ VisualStudio \ v15.0". These search paths are defined in "C: \ Users \ xxx \ AppData \ Local \ Microsoft \ VisualStudio \ 15.0_558e146f \ devenv.exe.config". Make sure that the path in the declaration is correct and that the file exists on disk in one of the search paths.
I found a solution to this error here .
In my case, the .csproj file contained the following lines:
<PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v14.0</VSToolsPath> </PropertyGroup>
After replacing v14.0 with v$(VisualStudioVersion) in the VSToolPath tag VSToolPath project can be loaded.
I also replaced v14.0 from v10.0 in the VisualStudioVersion tag, as a solution in the link above shows. But for me, this also worked, leaving it at 14.0.
Here's how these lines should look at the end:
<PropertyGroup> <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion> <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath> </PropertyGroup>
If you do not have these lines in your .csproj, then you must add them manually directly BEFORE this line:
<Import Project="$(VSToolsPath)\Web\Microsoft.Web.Publishing.targets" Condition="'$(VSToolsPath)' != ''" />
In my case (a slightly different error message, but the same problem) was this line:
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
It seems that projects created in versions of Visual Studio since 2011 contain strings with VSToolsPath overrides, but this is not the VSToolsPath in older files. Visual Studio never added them automatically when upgrading to the new version of VS, so you should add them if they are not there.
Source of this information: https://developercommunity.visualstudio.com/content/problem/27735/project-fails-to-load-with-error-regarding-microso.html?childToView=123664#comment-123664 (click on Show more comments to see the entire discussion thread - unfortunately, I can’t directly link to the comments in this "more" section.)