In ASP.NET Core 3.0, endpoint routing is the suggested approach for terminal middleware (also called 'endpoints') as it provides a few benefits. Endpoint routing was introduced in ASP.NET Core 2.2, but was restricted to MVC only.
The first point has been pretty well publicised. The generic host does not allow injecting services into the Startup class.The canonical way to configure middleware in ASP.NET Core 3.0 is to use endpoint routing.The migration guide document does a good job of walking you through the required steps, so I strongly suggest working your way through that document.įor the most part I only had to address two issues: But what does that mean for the average developer that has an ASP.NET Core 2.x app, and wants to update to 3.0? I've migrated several apps at this stage, and it's gone pretty smoothly so far. NET Core 3.0 the ASP.NET Core 3.0 hosting infrastructure has been redesigned to build on top of the generic host infrastructure, instead of running in parallel to it. Migrating to the generic host in ASP.NET Core 3.0 NET Core 3 you can not longer inject arbitrary services into the Startup constructor. In this post I describe one of the changes to Startup when moving from an ASP.NET Core 2.x app to.