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


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.


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:

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

Don't forget to add:


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:

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

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:


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:


Clean and rebuild the project. And the error disappears.