Migration is hard: ASP.NET-based systems depend on outdated libraries, and ASP.NET Core works in a different way
ASP.NET Framework applications are hard to update because they rely on System.Web, HttpContext, outdated packages, old build tools, and deprecated APIs.
Features like session-state and authentication work differently in ASP.NET Core, meaning they cannot just be copied over and must be rewritten.
Supporting libraries often depend on several other packages, requiring you to upgrade them in a specific order. Additionally, the entire hosting model has changed. A middleware pipeline has replaced the older modules and handlers, changing how the application processes requests.
Because the code is usually deeply interconnected, upgrading these older .NET applications is difficult, typically taking experienced ASP.NET Core engineering teams several months to finish.
Incremental migration: move ASP.NET-based system in small parts while it keeps working
Microsoft recommends incremental migration using the Strangler-Fig pattern for large applications with well-known dependencies or those that depend on System.Web. This approach keeps the code of old and new systems working side by side, so the core business application stays online.
Full, total or complete rewrites at once are only recommended for small applications with minimal dependencies.
Engineering teams at modernization vendors, such as Belitsoft, use the Strangler-Fig pattern to migrate applications piece by piece, replacing legacy modules one by one without downtime.
Question
We have a healthcare platform built on old ASP.NET MVC. As we get more users, the site is slowing down, and our server bills are too high. We need to move to the latest .NET so we can use Linux and cut costs.
Database. All our data code uses NHibernate. We want to use the new ASP.NET Core Identity for logins, but it is built to work with Entity Framework Core. Should we rewrite our entire database just to fit EF Core?
User Passwords. We have thousands of doctors and providers using the site. The old system and the new one use different ways to encrypt passwords. We cannot ask everyone to reset their passwords.
Plugins. We rely on MvcSiteMapProvider and legacy DevExpress for reports. Neither works with modern .NET. Is there a way to make these work, or do we have to build the menus from scratch and purchase an upgrade to the latest DevExpress?
We want to cut our server costs by switching to Linux. Should we try to move the current code over as-is, or is it better to just rewrite these specific parts from scratch?
Answer
Database. Do not rewrite your database to fit EF Core. Keep your NHibernate logic for complex data, but use Dapper to connect ASP.NET Core Identity. Dapper is a "micro-ORM" that does not depend on EF Core rules. It will work with your existing tables without a schema rewrite, and it is faster than what you are using now.
User Passwords. When a doctor logs in, the system checks the old hash. If it matches, the system immediately re-hashes it using modern security standards and saves it to the new database. The user never notices anything.
Plugins. MvcSiteMapProvider does not work on modern .NET. Build a custom navigation view component that will not break in the next update. For DevExpress, manually upgrade the report files to the latest release. This is some manual work, but much cheaper than a total rewrite.
Moving to Linux and containers will cut costs. Given your setup, rewriting only the Identity and navigation modules is the right approach. The rest can be ported directly to the new .NET LTS framework.
Rate this article
Recommended posts
Our Clients' Feedback
We have been working for over 10 years and they have become our long-term technology partner. Any software development, programming, or design needs we have had, Belitsoft company has always been able to handle this for us.
Founder from ZensAI (Microsoft)/ formerly Elearningforce