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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With