Migrating from ASP.NET Framework 4.8 to .NET 8
Updated: This guide has been updated to target .NET 8 LTS (the previous version targeted .NET 7 which is now EOL).
Migrating from ASP.NET Framework 4.8 to .NET 8 is a significant undertaking but brings major benefits including cross-platform support, improved performance, and modern development patterns.
Before You Begin
- Ensure you have Visual Studio 2022 (17.8 or later)
- Install the .NET 8 SDK
- Review your dependencies for .NET 8 compatibility
Step 1: Analyze Your Project
Use the .NET Upgrade Assistant:
dotnet tool install -g upgrade-assistant
upgrade-assistant analyze YourProject.csproj
Step 2: Create New .NET 8 Project
Create a new project with the same type:
dotnet new webapp -n YourProject.New -f net8.0
Step 3: Migrate Code
Key differences to address:
- Startup.cs is replaced by Program.cs with minimal hosting
- System.Web references must be removed
- Use dependency injection instead of static helpers
- Replace Web.config with appsettings.json
- Update authentication to ASP.NET Core Identity
Step 4: Update Dependencies
Replace Framework packages with .NET 8 equivalents:
- Newtonsoft.Json - still works, or use System.Text.Json
- Entity Framework - migrate to EF Core 8
- ASP.NET MVC - built into ASP.NET Core
Step 5: Configure for Plesk
- Publish:
dotnet publish -c Release - In Plesk, set .NET Core Version to 8.0.x
- Set Application Startup File to YourProject.dll
- Deploy via Web Deploy or FTP
Resources
- Microsoft Upgrade Assistant documentation
- Our "Getting Started with .NET 8" article
- Our "Troubleshooting .NET 8 Application Errors" article