Change target framework:
<TargetFramework>netcoreapp3.1</TargetFramework>or for libraries:
<TargetFramework>netstandard2.1</TargetFramework>Get rid of All or App package:
<PackageReference Include="Microsoft.AspNetCore.All" />SerializerSettings in AddJsonOptions are no longer available.
CreatedAtRoutenow throws an errorInvalidOperationException: "No route matches the supplied values."if supplied params doesn't match the endpoint method signature.- An attempt to call an endpoint where the specified method is missing will now return a
MethodNotAllowedHTTP status code instead ofNotFoundin .NET Core 2.x.
Internal namespace is removed:
using Microsoft.AspNetCore.Http.Internal;Method EnableRewind is replaced with EnableBuffering.
The propery HttpContext.Authentication has been removed which breaks compatibility with older versions of IdentityServer4.
IMutableEntityType no longer contains definition for Relational. Should be replaced with new API. See discussion here.
Some RelationalEventId members are removed or changed:
QueryPossibleExceptionWithAggregateOperatorreplaced withQueryPossibleExceptionWithAggregateOperatorWarning.QueryClientEvaluationWarningis no longer supported.
Migrations are no longer available by default and must be installed explicitly. For the CLI the following command should be issued:
dotnet tool install --global dotnet-efWhen using Visual Studio's Packet Management Console (PMC) the following references must be added to a project contaning migrations:
<ItemGroup>
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
</ItemGroup>and the startup project must contain:
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="3.1.5">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>Without this changes such commands as Add-Migration are not available in PMC.
IdentityServer4 depends on AutoMapper which requires to upgrade it to version 9.0.0. This version has some breaking changes and in particular doesn't support automatic mappings by default.
- ASP.NET Core breaking changes
- IdentityServer4
- Use ASP.NET Core APIs in a class library
- Design-time DbContext Creation
- Handling Concurrency Conflicts
- Custom Migrations History Table
- How to migrate from Newtonsoft.Json to System.Text.Json
- Migrate from ASP.NET Core 2.2 to 3.0
- Migration from Asp.Net Core 2.2 to 3.1 — Real project
- Миграция с .NET Core 2.2 на .NET Core 3.1 на примере реального проекта