Migrate from ASP.NET Core 2.2 to 3.0 Preview
By Scott Addie
This article explains how to update an existing ASP.NET Core 2.2 project to ASP.NET Core 3.0.
Update the project file
Set the Target Framework Moniker (TFM) to
There's a known issue in Preview 1: projects that don't start with
<Project Sdk="Microsoft.NET.Sdk.Web">get compiler or runtime errors due to missing
Microsoft.AspNetCore.*assemblies. This is most often the case for test projects and class libraries. The workaround is to add the following to the .csproj file.
<ItemGroup> <FrameworkReference Include="Microsoft.AspNetCore.App" /> </ItemGroup>
For more information, see NuGet/Home issue #7342.
Microsoft.AspNetCore.*packages to the current preview (for example, 3.0.0-preview-18579-0053).
If there is no 3.0 version of a package, the package might have been deprecated in 3.0. Many of these are part of
Microsoft.AspNetCore.Appand should not be referenced individually anymore. For a preliminary list of packages no longer produced in 3.0, see aspnet/AspNetCore #3756.
Some assemblies were removed from
Microsoft.AspNetCore.Appbetween 2.x and 3.0. You may need to add
<PackageReference>items if you're using APIs from packages listed in aspnet/AspNetCore #3755
System.Data.SqlClientare no longer part of
Microsoft.AspNetCore.App. The list of assemblies shipping in
Microsoft.AspNetCore.Apphasn't been finalized yet and will change before 3.0 RTM.