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

12,155

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.

Share:
12,155

Related videos on Youtube

arame3333
Author by

arame3333

Updated on May 21, 2022

Comments

  • arame3333
    arame3333 almost 2 years

    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?

    • Rocklan
      Rocklan almost 6 years
      I get this error on the command line, but not from within Visual Studio. Driving me nuts.