How do I migrate a legacy ASP.NET webforms application with NET Framework 4.8 to .NET 8? We are using Telerik controls a lot.
What thechnology to use, Blazor, MVC, Razor? I need to do do the migration in steps and run in paralel both frameworks.
Database is SQL Server.
Manoj KallaPosted Oct 18, 2024, 2:07 PM
Hello Lucian,
Migrating to .NET 8 can be a smooth process, and I'm here to guide you through it. You have several options for technology, including Blazor, MVC, and Razor. Here's a quick overview to help you decide:
Remember, the foundation of any web application remains HTML, CSS, and JavaScript. Browsers interpret only these languages, so your existing WebForms, which use server-side controls or HTML, can be leveraged directly. You can use CSS and JavaScript without modification.
Here's a suggested approach:
1. WebForms Transition: Start by executing a simple WebForm page, such as contactus.aspx. Copy the source HTML, CSS, and JavaScript, and paste them into the relevant view file, like inside the HOME controller with a ContactUS Action Method. For example, convert ` ` to ``. Avoid HTML helpers and focus on using HTML controls and client-side validation.
2.Data Management: Move your CRUD operations to a class library using .NET Standard if feasible. This will future-proof your code. If not, keep them within the controllers.
3.Embrace New Features: To harness the full potential of .NET 8, utilize ASYNC, TASK, IACTIONRESULT, and incorporate dependency injection and caching.
If you find my approach helpful, I can walk you through each step in detail.
Tuhin PaulPosted Oct 17, 2024, 3:17 AM
Step-by-step migration will help reduce risks and ensure that your application continues to run while you transition to .NET 8.
Phase 1: Analysis and Preparation
Phase 2: Modernize the Database Access Layer
Phase 3: Migrate Authentication and Authorization
Phase 4: Migrate One Section at a Time
/new-pagethat points to the new .NET 8 Blazor/Razor Page.Phase 5: Replace WebForms Controls Gradually
Phase 6: Migrate the Core Business Logic
Phase 7: Migrate Complex Pages and Finish the Migration
Testing and Deployment
Tuhin PaulPosted Oct 17, 2024, 3:16 AM
ASP.NET WebForms is not supported in .NET Core and beyond, including .NET 8. This means that you’ll need to replace WebForms with modern web technologies like Blazor, Razor Pages, or ASP.NET Core MVC.
Since you are heavily using Telerik controls, it’s important to check whether Telerik offers support for Blazor or ASP.NET Core MVC controls (which they do).
There are three main options for replacing WebForms:
Recommendation: Since you are migrating in steps and want to run the old and new parts of the application in parallel, Blazor is a good option because it’s closer to WebForms in terms of UI interaction, and Telerik offers Blazor components. You can also consider Razor Pages if you want something lightweight but familiar.
During migration, you can use the side-by-side approach where you run parts of your application in .NET Framework (WebForms) and others in .NET 8 (Blazor, Razor Pages, or MVC).