Best practise to migrate Web Forms to ASP.NET Core MVC

后端 未结 3 1024
迷失自我
迷失自我 2021-02-19 06:26

I am trying to migrate a project from classic ASP.Net Web Forms to ASP.NET MVC.

While I have read through http://www.codeproject.com/Articles/38778/ASP-NET-WebForms-and-

相关标签:
3条回答
  • 2021-02-19 06:47

    Microsoft is a bit hush hush on the subject but the WebForms engine is probably never going to make its way to ASP.NET Core. One might think that MS is waiting to see if the community is calling for a port, but I think they're trying to kill it discretely (not like Silverlight).

    Why? Because it proved to be a bad good idea on the long run, easy to use at first, but extremely complex to master (because of viewstate and page lifecycle), with a tendency to allow average developers to build very tedious application (in french we say steam factories). Also it was very poorly adapted to modern web development (Ajax, unit testing, IoC). They tried to fix it with a couple of tweaks, but the overall architecture is just not adapted to this kind of things. MVC is a treat in comparison!

    To answer your question, it's not really possible to migrate WebForms to MVC, because those are quite different architectures, and of course the architecture is what an application sits on top on, so if you change it, you might as well rewrite it from scratch.

    What can help you a lot is if your app is divided in tiers (business, data access, UI). If it's not the case, you could start by doing this, properly separating the UI project from the rest. Then you would just have to rewrite the ASP.NET project and not the rest.

    0 讨论(0)
  • 2021-02-19 06:51

    There are some useful resources I'd like to share with the StackOverflow community just in case you are having troubles to decide what to do:

    • modernization of your existing Web Forms app
    • migration to MVC or Core
    • or whether to start a new project on Web Forms, MVC and Core.

    Here you go:

    • https://www.telerik.com/blogs/review-of-telerik-toolsets-for-aspnet-web-forms-core
    • Modernizing ASP.NET Web Forms Applications by Tomáš Herceg (Microsoft MVP ) - https://tomasherceg.com/blog/post/modernizing-asp-net-web-forms-applications-part-1
    • Migrating Old ASP.NET Applications to .NET Core by Edi Wang (Microsoft MVP) - https://edi.wang/post/2018/10/31/migrating-old-aspnet-applications-to-net-core
    • Choose between ASP.NET and ASP.NET Core (Microsoft docs) - https://docs.microsoft.com/en-us/aspnet/core/fundamentals/choose-aspnet-framework?view=aspnetcore-3.1
    • Migrate from ASP.NET to ASP.NET Core (Microsoft docs) - https://docs.microsoft.com/en-us/aspnet/core/migration/proper-to-2x/?view=aspnetcore-3.1
    0 讨论(0)
  • 2021-02-19 07:07

    i have come across below links

    https://www.youtube.com/watch?v=CZuqMrWSano https://www.dotvvm.com/blog/59/Modernizing-ASP-NET-Web-Forms-applications-with-DotVVM

    DotVVM package helps us to migrate ASP.Net Web Forms migration to ASP.NET Core without re-writting completely.

    i have not tried any production application. still have tried some sample pages. you can try this out.

    0 讨论(0)
提交回复
热议问题