General recommendations to convert Web Forms VB.NET Monolith to .Net 6 C#

Brian 161 Reputation points
2021-10-20T16:34:29.05+00:00

I'm working on converting an enterprise type web app from .NET Framework 4.8 (VB and Web Forms) to .NET 6 (C#). The app is quite large for a single developer - hundreds of database tables, nearly 1,000 stored procedures, hundreds of thousands lines of code with code behind files being thousands of lines, very dated UI.

Because I need to deploy upgraded features ASAP, I'm planning to break the current app down piece by piece. I started using Razor pages and Entity Framework and plan to just have the UI layer and a business logic layer (and possibly a DAL). I also plan to upgrade the new system frequently (at least for every new LTS version of .NET) . I know this is very broad and there isn't a single right answer, but I'm just looking for some feedback from a software architecture standpoint and any tips for tackling a large project like this. Thanks in advance.

Developer technologies | ASP.NET | Other
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 77,926 Reputation points Volunteer Moderator
    2021-10-21T02:11:35.453+00:00

    It will depend on the quality of the code of the previous site. If it used a dal or an ORM then this can be converted. If it used webform direct databinding then it’s more work.

    Webforms was component based, and razor pages is template based, so you will redesign this.

    You may need a new state management design. Webforms stored page state in a hidden field. You will want a new approach.

    An approach you might want to look at, is to first convert the site to 4.8 mvc 5 in place. You can recode each page one by one or a group, but still have a running site. Then it’s a simple migrate to .net 6. Just be sure to learn the features not in asp.net core (HttpContext.Current for example). You can build a parallel .net 6 site to test compatibility.

    The main downside, is your new code will be limited to c# 7.3 features.

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Lan Huang-MSFT 30,191 Reputation points Microsoft External Staff
    2021-10-21T05:46:11.027+00:00

    Hi @Brian ,
    Currently .net 6 does not support webform, only c# 10 is supported.
    https://dotnet.microsoft.com/download/dotnet/6.0
    Best regards,
    Lan Huang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.