--- title: Migrate from ASP.NET Core 2.1 to 2.2 author: scottaddie description: This article outlines the prerequisites and most common steps for migrating an ASP.NET Core 2.1 project to ASP.NET Core 2.2. ms.author: scaddie ms.custom: mvc ms.date: 12/08/2018 uid: migration/21-to-22 --- # Migrate from ASP.NET Core 2.1 to 2.2 By [Scott Addie](https://github.com/scottaddie) This article explains how to update an existing ASP.NET Core 2.1 project to ASP.NET Core 2.2. [!INCLUDE[](~/includes/net-core-prereqs-all-2.2.md)] ## Update Target Framework Moniker (TFM) Projects targeting .NET Core should use the [TFM](/dotnet/standard/frameworks#referring-to-frameworks) of a version greater than or equal to .NET Core 2.2. Update the `` node's inner text with `netcoreapp2.2`: ```xml netcoreapp2.2 ``` Projects targeting .NET Framework may continue to use the TFM of a version greater than or equal to .NET Framework 4.6.1: ```xml net461 ``` ## Adopt the IIS in-process hosting model To adopt the [in-process hosting model for IIS](xref:fundamentals/servers/aspnet-core-module#in-process-hosting-model), add the `` property with a value of `InProcess` to a `` in the project file: ```xml InProcess ``` For more information, see . ## Update package references If targeting .NET Core, remove the `Version` attribute for the metapackage reference. Inclusion of a `Version` attribute results in the following warning: ```console A PackageReference to 'Microsoft.AspNetCore.App' specified a Version of `2.2.0`. Specifying the version of this package is not recommended. For more information, see https://aka.ms/sdkimplicitrefs ``` The metapackage reference should resemble the following `` node: ```xml ``` If targeting .NET Framework, update each package reference's `Version` attribute to 2.2.0 or later. Here are the package references in a typical ASP.NET Core 2.2 project targeting .NET Framework: ```xml ``` ## Update .NET Core SDK version in global.json If your solution relies upon a [global.json](/dotnet/core/tools/global-json) file to target a specific .NET Core SDK version, update its `version` property to the 2.2 version installed on your machine: ```json { "sdk": { "version": "2.2.100" } } ``` ## Call ConfigureKestrel instead of UseKestrel If the app calls in the `CreateWebHostBuilder` method of the `Program` class, call `ConfigureKestrel` instead to avoid conflicts with the [IIS in-process hosting model](xref:fundamentals/servers/aspnet-core-module#in-process-hosting-model): ```csharp public static IWebHostBuilder CreateWebHostBuilder(string[] args) => WebHost.CreateDefaultBuilder(args) .UseStartup() .ConfigureKestrel((context, options) => { // Set properties and call methods on options }); ``` For more information, see . ## Update compatibility version Update the compatibility version in `Startup.ConfigureServices` to `Version_2_2`: ```csharp services.AddMvc() .SetCompatibilityVersion(CompatibilityVersion.Version_2_2); ``` ## Update Docker images The following table shows the Docker image tag changes: | 2.1 | 2.2 | | ----------------------------------------- | ----------------------------------------- | | `microsoft/dotnet:2.1-aspnetcore-runtime` | `microsoft/dotnet:2.2-aspnetcore-runtime` | | `microsoft/dotnet:2.1-sdk` | `microsoft/dotnet:2.2-sdk` | Change the `FROM` lines in your *Dockerfile* to use the new image tags in the preceding table's 2.2 column. ## Additional resources * * * [Implicit package references](/dotnet/core/tools/csproj#implicit-package-references)