I'm upgrading a system from ASP.NET Core 5 to 6. I've read the migration guide for the new "minimal hosting model".
The docs say the new way is preferred and recommended, but the old way is supported - so I don't need to change. They also state the old way is useful for "advanced" scenarios, without mentioning details.
There's lots of docs / blogs / SO questions about how to use the new way - but no mention of why. An "app in just four lines" is given as a reason, but that is insufficient cause to migrate a working system.
I'll upgrade to v6, but am undecided about the hosting model. How would I or my working production system benefit?
If you migrated a production system to the new hosting model, would you please share advice about whether it was worth it? What are the pros (and cons) of the new approach? Thanks!
Unifies Startup.cs and Program.cs into a single Program.cs file.
, that's a disadvantage. In my case, I use a mix of the new hosting model (in Program.cs) with an existingStartup
class that does the bootstrapping. This allows me to use packages such as FastEndpoints and other features that are available to the new interface. – Amata