ASP.NET Core 5.0 Runtime (v5.0.10) - Windows Hosting Bundle Installer!
I upgraded one of my websites from .NET Core 2.1 to .NET 5. The experience was quite smooth. It took me about 1 hour to upgrade and publish it back to the web hosting vendor.
Here are the steps:
1. Download ASP.NET Core 5.0 Runtime from the link for dotnet-hosting-5.0.10-win.exe
2. Update Target framework to from .NET Core 2.1 to .NET 5.0.
3. HostingEnvironment is obsolete. Need to replace it with IWebHostEnvironment.
4. Replace UseMvc() with UseEndpoints(). Here are the details.
1 2 3 4 5 6 7 8 9 10 11 | // Obsolet: app.UseMvc(); // https://docs.microsoft.com/en-us/aspnet/core/migration/22-to-30?view=aspnetcore-3.0&tabs=visual-studio app.UseRouting(); app.UseEndpoints(endpoints => { // mvc endpoints.MapControllerRoute("default", "{controller=Home}/{action=Index}"); endpoints.MapRazorPages(); }); |
Cheers!