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
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.