Incremental migration of a .NET Framework monolith to .NET 10: strangler fig with a YARP front, System.Web adapters for shared auth and session, choosing slices, data strategy, and measuring progress.
I wouldn't rewrite it. I'd use the strangler fig pattern: put a new ASP.NET Core 10 app in front, with YARP proxying every route it doesn't handle yet to the old .NET Framework 4.8 app. Then I move features route by route, starting with slices that are valuable and loosely coupled, while the team keeps shipping.
The tricky parts are shared state: I use System.Web adapters to share authentication and session between the two apps, multi-target shared libraries to .NET Standard 2.0, and keep one database until the code has moved, so I'm never migrating code and data in the same step.
I measure progress by the percentage of traffic served by the new app, legacy code deleted, and error rate and p95 per migrated route, with a flag to send a route back.
The trade-off: running two apps for a while costs effort, but every step is small and reversible.
"Big-bang rewrites of systems the business depends on have a terrible track record: the new system chases a moving target, and value arrives only at the end. So I'd use the strangler fig pattern. First I'd stand up a new ASP.NET Core 10 app that sits in front of everything, with YARP configured so any route it doesn't own is proxied to the existing MVC 5 app. On day one, users see no difference. Then we move one slice at a time: a set of routes, their views or API endpoints and their logic, into the new app, and flip the route in YARP behind a feature flag.
For example, at [company] we had a [400k-line] MVC 5 [claims portal]. I wrote an ADR for the strangler approach and ran a two-week spike to prove the hard parts: forms authentication shared through the System.Web adapters' remote authentication, session shared through remote session, and our shared business libraries retargeted to .NET Standard 2.0. We picked the first slice by value and coupling: the [document upload] area changed every sprint and had few dependencies. We kept one SQL Server database so only code moved. Over [18] months we moved [85%] of traffic to .NET 10 on Linux App Service, error rate per migrated route stayed [at or below] the legacy baseline, and hosting dropped by [40%] when we retired the Windows VMs. Feature work never stopped; about [30%] of capacity went to migration.
The mistake I see is starting with the most complex, central module, or trying to redesign the domain and the data model at the same time as the framework. My senior line is: make the migration boring: small slices, one kind of change at a time, and a rollback switch for every route."
┌────────────────────────────────────┐
users ──► │ ASP.NET Core 10 app (Linux) │
│ /documents/* → handled here │
│ /claims/search → handled here │
│ everything else → YARP ──────┐ │
└────────────────────────────────────┘
▼
┌────────────────────────────┐
│ MVC 5 / .NET Framework 4.8 │
│ (Windows, IIS) │
└────────────────────────────┘
both ──► one SQL Server database (for now)
| Criterion | Prefer first | Defer |
|---|---|---|
| Coupling | Few dependencies, clear routes | Central, shared by everything |
| Change frequency | Changes every sprint (migration pays back fast) | Stable, rarely touched |
| Risk | Moderate, well understood | Payment/settlement core |
| Tech blockers | Plain MVC/Web API | WCF server, WebForms, System.Web deep usage |
| Concern | Approach |
|---|---|
| Authentication | System.Web adapters remote authentication, or move both to OIDC with Entra ID |
| Session | System.Web adapters remote session, then remove session dependence |
| Shared libraries | Retarget to .NET Standard 2.0 or multi-target net48;net10.0 |
| Data | One database first; module ownership later |
| Config/secrets | Key Vault for both apps |
Over [18] months the strangler migration moved [85%] of traffic to .NET 10, kept migrated-route error rates at or below baseline, cut hosting by [40%] after retiring Windows VMs, and reduced deploy time from [45] to [8] minutes, without a feature freeze.
Checks whether the candidate can plan a realistic, incremental legacy migration that keeps delivering, handles shared state, and is measurable and reversible.
Green flags
Red flags
Martin Fowler named it after vines that grow around a tree until they replace it. The key properties: the old system keeps running, value is delivered continuously, and every step can be reversed. It turns one huge risk into many small ones.
YARP (Yet Another Reverse Proxy) is a Microsoft library that runs inside ASP.NET Core. In the new app, local endpoints are matched first; a catch-all route with low priority forwards everything else to the legacy app. Microsoft's incremental migration guidance uses exactly this setup.
Request ──► ASP.NET Core routing
├─ matches local endpoint? ──► handle in .NET 10
└─ no ──► MapForwarder("/{**catch-all}", legacyUrl) (lowest order)
Because YARP is just middleware, you can wrap a route's switch in a feature flag, send a percentage of traffic, and observe both sides in Application Insights.
Microsoft.AspNetCore.SystemWebAdapters provides:
HttpContext.Current-like surface) so shared code using System.Web types can compile against .NET 10.These are transition tools; the end state removes session dependence and moves auth to OIDC (for example Microsoft Entra ID).
| Legacy tech | Modern path |
|---|---|
| ASP.NET MVC 5 / Web API 2 | ASP.NET Core MVC or Minimal APIs |
| WebForms | Rewrite pages (Razor Pages, Blazor) slice by slice |
| WCF server | CoreWCF, or gRPC/HTTP APIs |
| EF6 | EF6 runs on .NET Core 3.1+; move to EF Core later |
System.Web everywhere |
Adapters, then refactor |
| AppDomains, Remoting | Processes, containers, HTTP/gRPC |
The .NET Upgrade Assistant (and GitHub Copilot's app modernisation tooling, which Microsoft now promotes for this) automates project file conversion and package updates; it doesn't do the architectural work.
Changing framework, architecture and data model at once multiplies risk. Sequence:
Publish a burn-up chart; it keeps leadership support when the migration spans many quarters.
MapForwarder to an existing site and confirm unmatched routes pass through.Microsoft.FeatureManagement.netstandard2.0 and fix the compile errors.The new ASP.NET Core 10 front door: migrated routes are local; everything else goes to the legacy app through YARP.
// Program.cs (new ASP.NET Core 10 app)
using Microsoft.FeatureManagement;
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddHttpForwarder();
builder.Services.AddFeatureManagement();
builder.Services.AddSystemWebAdapters()
.AddRemoteAppClient(o =>
{
o.RemoteAppUrl = new Uri(builder.Configuration["Legacy:Url"]!);
o.ApiKey = builder.Configuration["Legacy:ApiKey"]!; // from Key Vault, shared with the legacy app
})
.AddAuthenticationClient(isDefaultScheme: true) // reuse the legacy forms-auth login
.AddSessionClient(); // read/write legacy session during transition
builder.Services.AddControllersWithViews();
var app = builder.Build();
app.UseRouting();
app.UseAuthentication();
app.UseAuthorization();
app.UseSystemWebAdapters();
// Migrated slice: documents. Behind a flag so a route can be sent back to legacy instantly.
app.MapControllers();
app.MapGet("/documents/{id:guid}", async (Guid id, IFeatureManager flags, HttpContext ctx, CancellationToken ct) =>
await flags.IsEnabledAsync("Migrated.Documents", ct)
? Results.Ok(new { id, source = "net10" })
: Results.StatusCode(StatusCodes.Status404NotFound));
// Everything not handled above goes to the .NET Framework app.
app.MapForwarder("/{**catch-all}", app.Configuration["Legacy:Url"]!)
.WithOrder(int.MaxValue)
.ShortCircuit();
app.Run();
<!-- Shared business library used by both apps during the transition -->
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net48;net10.0</TargetFrameworks>
<Nullable>enable</Nullable>
<LangVersion>latest</LangVersion>
</PropertyGroup>
</Project>
In a real setup the flag would control which route table YARP uses rather than return 404; the snippet keeps the idea small.
The hardest part of a long migration is keeping organisational support. I make progress visible every month (traffic share, cost saved, deploy time) and tie slices to business features so migration work also ships value. I negotiate a steady capacity share (often 20-30%) rather than asking for a freeze.
I also decide explicitly what not to migrate: rarely used admin pages may be cheaper to retire or replace with a SaaS tool.
| Option | When it fits | Cost | When not to |
|---|---|---|---|
| Strangler fig with YARP | Web app with route-addressable features | Running two apps for a while | Tiny app that can be rewritten in weeks |
| In-place upgrade (Upgrade Assistant) | Class libraries, simple Web API, few System.Web dependencies |
Low-medium | Heavy WebForms, WCF server, deep System.Web |
| Rewrite | Small, well-understood system, or no longer fits the business | High risk | Large, business-critical, poorly documented |
| Retire/replace with SaaS | Commodity capability | Licence cost | Core differentiating domain |
I treat a large refactoring as a series of small, behaviour-preserving steps merged to main continuously, not a big-bang branch. First I pin current behaviour with characterisation tests. Then I pick a technique: strangler fig to route traffic piece by piece to a new implementation, branch by abstraction to put an interface in front of the old code and swap implementations behind it, or parallel change (expand, migrate, contract) for APIs and database schemas. Feature flags and shadow comparisons let old and new paths run side by side. I prioritise hotspots (code that changes often and hurts), keep refactoring commits separate from feature commits, and define an end state so it does not drag on forever.
I keep a modular monolith until a module has a measured reason to become its own deployable: it needs to scale independently, it has a different release cadence or owning team, it needs fault or security isolation, or it needs a different runtime. "Microservices are modern" isn't a reason.
The first candidate should have few inbound dependencies, a clean contract and its own schema already. Extraction is incremental: make the module talk only through its contract, stop cross-module joins and transactions, move its data, deploy it as a service, and switch traffic behind a feature flag with a rollback path.
The trade-off: every extracted module turns method calls into network calls, so you gain autonomy and isolation but pay with latency, partial failures and eventual consistency.
An anti-corruption layer is code on the downstream side that translates an upstream model into yours, so the upstream's names, codes and quirks never reach your domain. It has three parts. A port: an interface your domain defines in its own language (IIdentityVerifier). A facade/client: a typed HttpClient with AddStandardResilienceHandler() (timeouts, retries with jitter, circuit breaker). A translator: pure functions mapping both ways, vendor DTOs and codes to your value objects and your types to validated vendor requests. An adapter implements the port, lives in Infrastructure and is internal.
Unknown codes map to a safe outcome and are logged and metered so upstream changes are caught the same day. Test translators with unit tests, the adapter against WireMock.Net, and run contract tests against the sandbox. The trade-off: extra code, in exchange for surviving or replacing the upstream without touching the domain.
How to tell it (STAR)
**S:** At [company] our [400k-line] MVC 5 claims portal ran on Windows VMs with 45-minute deploys, and the business couldn't pause features. **T:** As tech lead I had to modernise it to .NET 10 without a freeze. **A:** I wrote an ADR for a strangler fig migration and ran a two-week spike proving YARP and System.Web adapters for shared login and session. I chose the first slice by value and coupling, agreed a [30%] capacity share with the product owner, and published a monthly burn-up. **R:** In [18] months [85%] of traffic ran on .NET 10, deploys dropped from [45] to [8] minutes, hosting fell [40%], and feature delivery continued throughout.
Last updated 23 Nov 2026.