How to migrate Asp.Net application to .Net Core application.

Willfin David 1 Reputation point
2021-01-05T15:56:54.857+00:00

Hi,

I would like to know what will be the easier and faster way to migrate an Asp.Net application to .Net core web application.

Regards,
David

ASP.NET Core
ASP.NET Core
A set of technologies in the .NET Framework for building web applications and XML web services.
4,346 questions
ASP.NET
ASP.NET
A set of technologies in the .NET Framework for building web applications and XML web services.
3,397 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Taylor 50,591 Reputation points
    2021-01-05T16:51:36.53+00:00

    Microsoft has already published migration guides for how to do this. Have you looked at them? Note that you should be targeting .NET 5 and not .NET Core now.

    In pretty much every case it is recommended that you create a brand new ASP.NET Core app and then migrate your existing app over to it. Hopefully you have already compartmentalized your app such that the only thing in your existing ASP.NET app is the runtime specific stuff like the controllers and views. If you haven't done that yet then start there.

    Once you've moved everything out of the ASP.NET app that isn't specific to the runtime then convert each project to support .NET Standard (or perhaps .NET 5) so you can multi-target .NET 4.7.2 and .NET 5. With the bulk of your code now supporting .NET 5 you can build the new ASP.NET Core app with just the code specific to the runtime. In many cases the controllers and views can be copied across directly but refer to the migration guide on differences to be aware of, especially around routing.

    0 comments No comments