When we are upgrading our existing class library to the latest .NET Core, like this:

<TargetFramework>netcoreapp3.0</TargetFramework>

On doing so, you may get the following warning:

C:\Program Files\dotnet\sdk\3.0.000\Sdks\Microsoft.NET.Sdk\targets
Microsoft.NET.Sdk.DefaultItems.targets(149,5): warning NETSDK1080: A PackageReference to Microsoft.AspNetCore.App is not necessary when targeting .NET Core 3.0 or higher. If Microsoft.NET.Sdk.Web is used, the shared framework will be referenced automatically. Otherwise, the PackageReference should be replaced with a FrameworkReference.

To fix this, if you are building a web project, please make sure the first line of your project file is:

<Project Sdk="Microsoft.NET.Sdk.Web">

In this case, it is automaticly included framework: Microsoft.AspNetCore.App. You don't have to include it again.

https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio#framework-reference

If you are building a razor library not a web project, please make sure the first line of your project file is:

<Project Sdk="Microsoft.NET.Sdk.Razor">

In this case, your library might dependend on some class in ASP.NET Core. You have to add this:

<ItemGroup>
    <FrameworkReference Include="Microsoft.AspNetCore.App" />
</ItemGroup>

Don't forget to add:

<AddRazorSupportForMvc>true</AddRazorSupportForMvc>

to <PropertyGroup>

If you are not building a razor library nor a web project, typically you don't need Microsoft.AspNetCore.App. If you can really make sure what you are doing and really need it , consider adding:

  <ItemGroup>
     <FrameworkReference Include="Microsoft.AspNetCore.App" />
  </ItemGroup>

And for possible error:

error CS8107: Feature 'default literal' is not available in C# 7.0. Please use language version 7.1 or greater.

This error is very strange. From the official Microsoft's document:

https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/configure-language-version

The latest .NET Core 3.0 is supporting the latest C# (C# 8.0). Which already supports the latest language features. This issue may occur if you are not using the latest Visual Studio.

To solve this, consider adding:

<LangVersion>latest</LangVersion>

Clean and rebuild the project. And the error disappears.