Click here to Skip to main content
15,560,045 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Some years ago I wrote a LoB application for a client. It uses ASP.Net Framework 4.x with WebForms. It's feature-rich, robust, and the client is now reliant on it. It's a multi-layer app with separate Data Access, Business, and Presentation layers. The presentation layer involves quite a bit of client-side Javascript (vanilla JScript with JQuery and very little else).

Both the client and I agree that, as the tool is now so central to their business, it's daft relying on a single person - me - to support and do any enhancements. They've no in-house IT capability. Trying to find a software house happy to take on support for what is now legacy technology is proving a non-starter.

Re-writing the whole thing in MVC / .Net Core would be a huge task. Given the layered nature, there'd be little benefit in rewriting the business and data layers anyway; and/or they could possibly be retained and ported to Framework Core.

Q: Is it possible to run a "mixed" website with both MVC and WebForms pages? (I assume not, but need to check!). I know WebForms won't run on .Net Core but earlier versions of MS MVC will run with .Net Framework.
Q: Is there a migration path (semi-automated or at least a methodology) to convert WebForms code to MVC under .Net Framework? (as a first stage prior to moving to .Net Core)
Q: Are there any service providers (pref. UK based) who routinely do this sort of migration?

What I have tried:

Tried - at length - to find support shops interested in taking over legacy code, without success!
Posted
Updated 21-Nov-22 2:12am

There is no easy bullet to migration, but there is plenty of advice on the internet. Here is a google search: webform to mvc migration - Google Search[^]

Here are a couple of results from that search:
* ASP.NET - Migrating ASP.NET Web Forms to the MVC Pattern with the ASP.NET Web API | Microsoft Learn[^]
* From WebForms to MVC, the first 10 minutes[^]
 
Share this answer
 
Comments
DerekT-P 22-Nov-22 6:36am    
Thanks Graeme. Going via WebAPI as per the first link you give looks like it "ought" to be do-able. Until you come to factor in all the WebForms goodness like MasterPages, Page inheritance, custom controls, session object and so on, that is.

As mentioned in another comment below, MS seem to be making web development harder, and requiring much greater breadth of knowledge. Perhaps it's no wonder there's such a multiplicity of 3rd party frameworks...
And when MS themselves say not to bother trying to migrate software from .Net Framework 5 to .Net Core... just mad. "Different enough that it makes Microsoft's point that you can't reasonably expect to migrate your ASP.NET MVC application to ASP.NET MVC Core."
Graeme_Grant 22-Nov-22 16:21pm    
Webforms is very old and was developed as a transition and competitor for a different era. To their credit, Microsoft has kept it maintained. MVC was developed for a modern era with totally different concepts. Blazor is yet another. If you look at Javascript and the frameworks available back when Winforms was released, and javascript today and the frameworks available, you would have the same problem there as you are now. Look at web browsers as another example, are you still using IE 6.0? It is what it is. Now it is up to you and your client to make a choice - do you stay with the old and hope that it is not phased out, or do you migrate now while webforms is still supported?
Microsoft is working on a tool to assist with incremental migration from ASP.NET to ASP.NET Core:
Migrating from ASP.NET to ASP.NET Core in Visual Studio[^]

However, WebForms is currently not "supported". I haven't tried the tool, so I don't know whether that means "doesn't work at all", or "works but can't be automatically migrated".

Another option may be to migrate to Blazor:
Migrate from ASP.NET Web Forms to Blazor | Microsoft Learn[^]
GitHub - FritzAndFriends/BlazorWebFormsComponents: A collection of Blazor components that emulate the ASP.NET Web Forms controls of the same name[^]
 
Share this answer
 
Comments
DerekT-P 22-Nov-22 6:25am    
Thank you Richard. I imagine there's no support for migrating WebForms as .Net Core doesn't support Webforms, so a direct "migration" isn't possible.

I'll take a look at the migration to Blazor; it's not something I know anything about, but that's true of Core, Framework 5, MVC and MVVM so whatever route we go I'll have a bit of a learning curve! :-)

What I am learning though is that all the WebForms replacements seem to require a lot more coding and basic "support" stuff from developers than WebForms, which looked after so much stuff. Seems MS are making development harder (particularly at the entry level) whilst also not providing a smooth "upgrade" path. (And yes, I realise I'm a way behind everybody at this point...)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900