Migrate your ASP.NET Core 2.2 application to ASP.NET Core 3.0 : Basic steps

The newest version of ASP.NET Core has released, and for for a lot of running applications this update will be somehow mandatory. This article will address important steps when upgrading your ASP.NET Core application from 2.2 to 2.3.

The project (.csproj) file

First thing first is to update the Target Framework to the netcoreapp3.0. There’s a long list of packages that are no longer being produced which can be removed from the csproj referenced packages, they are no longer available through the Microsoft.AspNetCore.App framework.


<!-- Microsoft.NET.Sdk.Web SDK implicitly references the Microsoft.AspNetCore.App -->

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

If your project targets the Razor SDK should add the framework reference to Microsoft.AspNetCore.App

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

For more info about what package references are removed from the Microsoft.AspNetCore.App and what to do to continue using features provided by there packages, check out the official docs.


In Program.cs, migrate the Kestrel confguration to the WebHostBuilder.

public static IHostBuilder CreateHostBuilder(string[] args) =>
        .ConfigureWebHostDefaults(webBuilder =>
            webBuilder.ConfigureKestrel(serverOptions =>
                // Set properties and call methods on options


Json.NET has been removed from the ASP.NET Core shared framework. In 3.0 we get the System.Text.Json namespace build in ASP.NET Core 3.0 ! Note that if you target .NET Standard or NET Framework install the System.Text.Json NuGet package. Below is a simple and clear example.

using System;
using System.Text.Json;
using System.Text.Json.Serialization;
namespace Project.Component.Service.Utils
    class Thing
        public string Name { get; set; }
        public int Count{ get; set; }
    class Program
        static void Main(string[] args)
            var thingy = new Thing() 
                    Name = "Tim", 
                    Count = 30,



Some changes must be or can be made to the Startup.cs configuration and services pipelines.

MVC Service Registration

In Startup.ConfigureServices there are some new options to register MVC scenarios. For example, there are new extensions on IServiceCollection available, these use new methods other than UseMvc(). However, you can still use UseMvc().

public void ConfigureServices(IServiceCollection services)
    services.AddControllers(); // Controller & API features
    services.AddRazorPages(); // Razor pages and minimal controller support


Best practice in ASP.NET Core 3.0 when using SignalR is to migrate to Endpoint Routing. This -in most cases- only takes some adjustments to Startup.cs.

public void Configure(IApplicationBuilder app)




    // App.UseSignalR and App.UseMvc is now configured on app.UseEndPoints.
    app.UseEndpoints(endpoints =>
        endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}/{id?}");

For most apps, calls to UseAuthentication, UseAuthorization, and UseCors must appear between the calls to UseRouting and UseEndpoints to be effective. – Docs

Most of these changes do not create any breaking changes to business logic in your application, at least it didn’ when I tested. Let me know if this helped you or if you have any questions.