This version of Microsoft.AspNetCore.All is only compatible with the netcoreapp2.1 target framework

后端 未结 10 1213
无人共我
无人共我 2021-02-04 23:24

When I try to publish my application to the web server after upgrading to .NET Core 2.1 from 2.0, I get this message: \"This version of Microsoft.AspNetCore.All is only compatib

10条回答
  •  情话喂你
    2021-02-05 00:07

    I was stuck with this issue for about 3 hours. Eventually, this error came when I added a Nuget package Microsoft.VisualStudio.Web.CodeGeneration.Design. This is what I did to solve this issue:

    1) Deleted bin folder of my .net core project

    2) Explicitly added the dotnet version to TargetFramework and PackageReference to 2.1.0. You can try adding what is best for your project and dotnet version.

    3) I restored the project with dotnet restore and then build with dotnet build

    4) At the end, my problem was solved and I no longer receive this error.

提交回复
热议问题