Advertisement
Advanced .NET, .NET vs .NET Framework

What migration strategies exist for gradually moving a large .NET Framework application to modern .NET rather than a big-bang rewrite?

Short answer

Common incremental strategies include: the 'strangler fig' pattern (build new features in modern .NET services alongside the legacy Framework app, gradually routing traffic away from old code), multi-targeting a shared class library to both net48 and net8.0 during a transition…

Save .NET mock interview
Advertisement
AModel answer
Common incremental strategies include: the 'strangler fig' pattern (build new features in modern .NET services alongside the legacy Framework app, gradually routing traffic away from old code), multi-targeting a shared class library to both net48 and net8.0 during a transition period to catch incompatibilities early, or splitting a monolith into a modern .NET API layer in front of a legacy Framework backend that's migrated piece by piece.
<!-- A shared library multi-targets both during transition -->
<TargetFrameworks>net48;net8.0</TargetFrameworks>

<!-- Conditional code for framework-specific APIs -->
#if NETFRAMEWORK
    // Framework-specific code
#else
    // Modern .NET code
#endif
Real-world example
A large e-commerce platform migrates module by module over 18 months, using the strangler fig pattern to gradually replace Framework-based order processing with a modern .NET 8 service while keeping the legacy checkout flow running unchanged until it's fully replaced.
Likely follow-ups
  • How do you handle shared state or databases during an incremental migration?
  • What's the risk profile of big-bang versus incremental migrations?
Related topics