Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The imported project "C:\Program Files\dotnet\sdk\2.1.201\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found

In Visual Studio 2017, I go to the Package Manager to do a dotnet restore. Then I get an error message

error MSB4019: The imported project "C:\Program Files\dotnet\sdk\2.1.201\Microsoft\VisualStudio\v15.0\WebApplications\Microsoft.WebApplication.targets" was not found.

I navigate to

C:\Program Files\dotnet\sdk\2.1.201\Microsoft

and the VisualStudio path is missing and hence the error message. How do I fix this?

like image 939
arame3333 Avatar asked May 22 '18 15:05

arame3333


1 Answers

If you have a mixed solution that contains both .NET Framework and .NET Core (web) projects, dotnet restore won't be able to build .NET Framework projects and will cause an error in newer versions of the .NET Core SDK, as detailed in NuGet/Home#6665.

If you are experiencing this error from the command line, but not from Visual Studio itself, you might have more luck building the full solution using MSBuild.

like image 133
Vivelin Avatar answered Nov 15 '22 20:11

Vivelin