Monthly Archives: February 2022

Using an existing Startup class with ASP.NET 6 minimal hosting model

With the .NET Core 2.1 having reached end of life, and the looming end of life dates for .NET 5 (this spring) and .NET Core 3.1 (this fall), a lot of developers are facing migrating their services to .NET 6.0. Depending on the customization level and the sheer scale of your service ecosystem this may be an easy or relatively complicated task – especially if you would like to additionally tap into the new lightweight hosting model around WebApplication type.

A very low-cost, easy approach to this is to take advantage of the fact that one can easily reuse an existing Startup class with the new hosting model too. This allows leaving most of the code intact, and performing only tiny refactorings around the host bootstrapping.

Continue Reading