Overview
This guide helps you understand the process of migrating from classic ASP.NET Framework (4.x) to modern .NET 10. Migration can improve performance, security, and access to new features.
Before You Begin
Assess Your Application
- Check dependencies: Some libraries may not have .NET 10 versions
- Identify breaking changes: Review Microsoft migration documentation
- Test thoroughly: Plan for extensive testing
- Consider partial migration: Migrate components incrementally
Key Differences
| ASP.NET Framework | .NET 10 |
|---|---|
| Windows only | Cross-platform |
| System.Web based | Microsoft.AspNetCore based |
| Global.asax | Program.cs / Startup.cs |
| Web.config for everything | appsettings.json + minimal web.config |
| IIS integrated | Kestrel + IIS (reverse proxy) |
Migration Steps
Step 1: Create New .NET 10 Project
# For MVC
dotnet new mvc -o MyApp.New -f net10.0
# For Web API
dotnet new webapi -o MyApp.New -f net10.0
# For Razor Pages
dotnet new webapp -o MyApp.New -f net10.0
Step 2: Migrate Configuration
From Web.config to appsettings.json:
// appsettings.json
{
"ConnectionStrings": {
"DefaultConnection": "Server=localhost;Database=MyDb;..."
},
"AppSettings": {
"Setting1": "Value1"
}
}
Access in code:
// Old way (ConfigurationManager)
var value = ConfigurationManager.AppSettings["Setting1"];
// New way (IConfiguration)
var value = _configuration["AppSettings:Setting1"];
Step 3: Update NuGet Packages
Replace Framework packages with .NET 10 equivalents:
System.Web.Mvc→Microsoft.AspNetCore.MvcEntityFramework→Microsoft.EntityFrameworkCoreNewtonsoft.Json→System.Text.Json(or keep Newtonsoft)
Step 4: Migrate Controllers
// Old (ASP.NET Framework)
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
}
// New (.NET 10)
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}
}
Step 5: Update Views
- Razor syntax is mostly compatible
- Replace
@Html.ActionLinkwith Tag Helpers - Update
@Scripts.Render/@Styles.Render
Step 6: Migrate Authentication
ASP.NET Core Identity replaces ASP.NET Membership:
builder.Services.AddDefaultIdentity<IdentityUser>()
.AddEntityFrameworkStores<ApplicationDbContext>();
Deploying to Plesk
- Publish your new .NET 10 application
- Upload files to your Plesk hosting
- Configure .NET Core settings in Plesk
- Set Application Startup File to your main DLL
- Test thoroughly
Running Both Versions
During migration, you can run both versions:
- Use a subdomain for the new .NET 10 version
- Test and validate before switching
- Keep the old version as fallback
Common Migration Issues
- Missing System.Web: Replace with ASP.NET Core equivalents
- HttpContext.Current: Use dependency injection instead
- Session state: Configure explicitly in .NET Core
- Bundling: Use different bundling approach