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

后端 未结 3 1009
迷失自我
迷失自我 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.

提交回复
热议问题