aspnetcore/migration/fx-to-core/start.md
[!IMPORTANT] Before you begin: This article assumes you have read the ASP.NET Core migration overview. If you haven't read it yet, please start there to understand the concepts, approach, and benefits of incremental migration.
For a large migration, we recommend setting up an ASP.NET Core app that proxies to the original .NET Framework app. The new proxy enabled app is shown in the following image:
This article provides the practical steps to proceed with an incremental migration after you understand the approach.
Before starting your incremental migration, ensure you have:
The incremental migration process follows these key steps:
The first step is to create the new ASP.NET Core application that will serve as your proxy.
What you'll do:
Detailed instructions:
When to do this step: Before upgrading any supporting libraries, address technical debt that could complicate the migration process.
Before you begin upgrading your supporting libraries, it's important to clean up technical debt that could interfere with the migration process. This step should be completed first to ensure a smoother upgrade experience.
Review and update your NuGet packages to their latest compatible versions:
dotnet CLI does not work for ASP.NET Framework applicationsUpdate your build tools and project configuration:
packages.config to PackageReference format if you haven't already in the Web application projectFix known code quality issues that could complicate migration:
This preparation work will make the library upgrade process much smoother and reduce the likelihood of encountering complex issues during migration.
When to do this step: While remediating technical debt but before upgrading supporting libraries, identify and configure cross-cutting concerns that affect your entire application.
Cross-cutting concerns are aspects of your application that span multiple layers or components, such as authentication, session management, logging, and caching. These need to be addressed early in the migration process because they affect how your ASP.NET Framework and ASP.NET Core applications communicate and share state during the incremental migration.
The following sections cover the most common cross-cutting concerns. Configure only the ones that apply to your application:
Configure this if: Your ASP.NET Framework application uses session state.
See the general session migration documentation for guidance here.
Session is a commonly used feature of ASP.NET that shares the name with a feature in ASP.NET Core, but the APIs are much different. When upgrading libraries that use session state, you'll need to configure session support. See the documentation on remote session support for detailed guidance on how to enable session state sharing between your applications.
Configure this if: Your ASP.NET Framework application uses authentication and you want to share authentication state between the old and new applications.
See the general authentication migration documentation for guidance here.
It is possible to share authentication between the original ASP.NET app and the new ASP.NET Core app by using the System.Web adapters remote authentication feature. This feature allows the ASP.NET Core app to defer authentication to the original ASP.NET app. See the documentation on remote authentication for more details.
Depending on your application, you may also need to address:
When to do this step: Only when you need to migrate specific routes that depend on class libraries containing business logic you'll need to share between the old and new applications.
[!NOTE] Incremental approach: With the incremental migration process, you don't need to upgrade all your supporting libraries at once. You only need to upgrade the libraries that are required for the specific routes you're currently migrating. This allows you to tackle the migration in smaller, more manageable pieces.
[!IMPORTANT] Supporting libraries must be upgraded in a postorder depth-first search ordering. This means:
- Start with leaf dependencies: Begin with libraries that have no dependencies on other libraries in your solution
- Work upward through the dependency tree: Only upgrade a library after all of its dependencies have been successfully upgraded
- End with the main application: The main ASP.NET Framework application should be the last item to be modified
This ordering is essential because:
- It ensures that when you upgrade a library, all of its dependencies are already compatible
- It prevents circular dependency issues during the upgrade process
- It allows you to test each library independently before moving to its dependents
NOTE: You only need to follow this ordering for the subset of libraries required by the routes you're currently migrating, not your entire solution.
Upgrade process for each library:
If you have supporting libraries in your solution that you will need to use for the routes you're migrating, they should be upgraded to .NET Standard 2.0, if possible. GitHub Copilot app modernization can help you with this. If libraries are unable to target .NET Standard, you can target .NET 8 or later either along with the .NET Framework target in the original project or in a new project alongside the original.
The System.Web adapters can be used in these libraries to enable support for xref:System.Web.HttpContext usage in class libraries. In order to enable xref:System.Web.HttpContext usage in a library:
System.Web in the project fileMicrosoft.AspNetCore.SystemWebAdapters packageThis step may require a number of projects to change depending on your solution structure and which routes you're migrating. GitHub Copilot app modernization can help you identify which ones need to change and automate a number of steps in the process.
Once you've completed the setup and library upgrade steps above: