I have a Web API project of below properties
Project .csproj
has clearly has below settings
<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
</PropertyGroup>
Build is success
in Visual Studio, But when I try to publish
the project I get below error
This version of Microsoft.AspNetCore.All is only compatible with the netcoreapp2.2 target framework. Please target netcoreapp2.2 or choose a version of Microsoft.AspNetCore.All compatible with netcoreapp2.1.
I am publishing using Visual Studio
menu options.
I am publishing to Azure app service
. Publishing to File System
is not showing any error.
I have nuget as follow
What can be the cause?
I just found a strange solution!
I have created new publish
profile and it worked like charm! seems like after changing project property from .Net Core 2.1 to .Net Core 2.2 we need to create a new profile always!