ASP.NET WebForms to ASP.NET Core Program Playbook
Migrate a legacy ASP.NET WebForms application to ASP.NET Core by extracting business logic into services, replacing the ViewState model, and rebuilding the UI incrementally. Modernize authentication and decommission WebForms after a validated cutover.
ASP.NET WebForms to ASP.NET Core Program
ASP.NET WebForms is a legacy framework built on a stateful page-lifecycle and ViewState model that does not map onto modern, stateless web architecture. This playbook migrates a WebForms application to ASP.NET Core, separating business logic from the UI and adopting modern request handling.
There is no automatic converter; the page-lifecycle and ViewState model has no direct equivalent. The realistic approach is to extract business logic, expose it through services, and rebuild the UI on a modern pattern.
Phase-by-Phase
Inventory and Strategy. Inventory pages, user controls, and code-behind. Extract the business logic buried in code-behind, which is the reusable value. Choose the target UI pattern: server-rendered Razor, an SPA over APIs, or a hybrid.
Service Extraction. Isolate the business layer out of code-behind, build APIs over it, and introduce dependency injection (built into ASP.NET Core but absent from classic WebForms). An anti-corruption layer keeps new services clean of WebForms assumptions.
UI Migration. Rebuild pages incrementally under the strangler-fig pattern, replace ViewState-driven state with explicit client or server state, and modernize authentication off the legacy membership provider.
Cutover and Retire. Validate parity, migrate traffic with blue-green, and decommission the WebForms app once traffic has moved.
Team and Roles
An architect owns the service boundary and target pattern. Backend engineers extract logic and build APIs. Frontend engineers rebuild the UI. QA validates parity against the legacy app.
Risks and Mitigations
- Business logic loss: capture code-behind logic as tests before extraction.
- Authentication gaps: plan the move off the membership provider early.
- Regression risk: validate each migrated page against the original.
Success Criteria
Business behavior reaches parity, page load improves over the postback-heavy original, and maintenance cost drops on the modern stack.
Tooling
Use ASP.NET Core with dependency injection, a modern UI framework, a modern identity provider, an anti-corruption layer, and parity test suites.