DEV Community

Upgrading .NET Is Easy. Keeping the Business Running Is the Hard Part.

What I check before any .NET upgrade, from MVC3 to .NET 10.

I shipped my first ASP.NET MVC application on MVC3. Since then I've moved banking platforms, oil & gas field software and several startup products through almost every version of .NET: Framework to Core, Core 3.1 to 6, 6 to 8, and now 8 to 10.

The technical side of these upgrades has become much easier over the years. The tooling is better, the migration guides are better, and the framework itself is far more consistent than it used to be. And yet upgrades still go wrong, and in my experience it is rarely because of the framework. It is almost always because of everything around it.

This isn't a step-by-step migration guide; Microsoft publishes good ones. It's what I check now, after enough upgrades to know where the pain usually comes from.

The dependency list doesn't tell you where the risk is

Every upgrade starts with the same spreadsheet: NuGet packages, target frameworks, and the WCF service nobody wants to touch. That list is necessary, but it is also the least risky part of the job.

The real risk sits in behaviour that nobody wrote down.

  • The exact shape of a JSON response.
  • The column order in an export that a partner imports every night.
  • A date format someone downstream parses by hand.

None of that shows up in a dependency graph.

So I start differently now. Before touching code, I sit with the team and list every consumer of the system, including other services, batch jobs, reports, partner integrations and the operations team's scripts, and we write down what each of them actually expects. In banking, a good part of that list turns out to be audit evidence you needed anyway.

Put tests at the edges before anything else

Unit tests tell you the code still does what the code did. They don't tell you the system still keeps its promises to the outside world.

Before migrating, I capture real requests and responses from the existing system and replay them against the new one. For HTTP APIs, recorded request and response pairs running in CI are often enough. For messaging, it means snapshotting the payloads that go onto the bus.

It's unglamorous work, and it is the main reason I can sleep the night after a cutover.

Strangle the old system instead of rewriting it

A big-bang rewrite is the most expensive way to discover what your old system really did. The approach that has worked reliably for me is the strangler fig pattern: put a routing layer in front of the legacy application, such as YARP or an API gateway, and move one route or module at a time to the new stack.

Each slice goes live on its own, behind a switch that can be flipped back.

It also changes the conversation with the business. "We need nine months and a feature freeze" is a hard sell. "The first piece goes live in three weeks, and you'll see progress every sprint" is a much easier one.

Treat the old system as the specification

Every team wants to fix things while they are in there: a cleaner schema, better names, a more RESTful API. The instinct is understandable, but during a migration it adds risk that is hard to see.

My rule is that when the old and new systems disagree, the old one is right until someone with business authority says otherwise. Bugs that customers or partners have built workarounds for are, in practice, features.

Migrate first and improve afterwards, and never in the same release. It keeps the changes explainable, the testing manageable and the rollback possible.

Fix the delivery pipeline before the application

If the build and release process is fragile, an upgrade will expose it. Before moving any production code, I make sure the pipeline (Azure DevOps on most of my projects) can build the old and new stacks side by side, run the edge tests on every commit, and deploy each migrated slice independently.

Configuration and feature flags belong in the pipeline and its environments, not on one engineer's machine or a single forgotten server.

Once that foundation is in place, the actual framework upgrade is often the quietest week of the project.

Why .NET 10 is a sensible target

.NET 10 is a long-term support release, supported until November 2028. That is long enough to justify the migration effort, and short enough that it's worth planning the next step from the start.

Runtime improvements mean many teams see performance gains simply by retargeting, which is worth measuring because it helps make the case for the work. And Aspire is useful for running old and new components together on a developer machine while the monolith is being strangled.

What I've learned

Frameworks change every year; MVC3 felt modern once. What carries over from one version to the next is the discipline of understanding what your system actually promises, and protecting those promises while everything underneath them changes.

If you're planning an upgrade this year, three questions are worth asking before you start:

  • Who depends on this system that we haven't spoken to yet?
  • What could break that no existing test would catch?
  • How do we roll back if the first slice fails?

The answers will tell you more about your timeline than any migration tool.

Read on DEV Community ↗ ← Back to News

Comments

No comments yet. Start the discussion.