Przejdź do treści głównej
Open Source Tool

NetLift: Automated .NET Framework Migration Tool

Reading time: ~12 minMichał Wojciechowski

I kept running into the same problem. Manual .NET Framework migration is tedious mechanical work: updating namespaces, rewriting DbContext configurations, converting XML configs to JSON, transforming MVC controllers. Hours of copy-paste and find-replace that any tool could handle.

Microsoft's Upgrade Assistant handles project files well, but it leaves the actual C# code untouched. You still have to manually rewrite controllers, update EF6 queries, migrate WCF services, transform Razor views. On a 100K line codebase, that's weeks of work.

So I built NetLift. It uses Roslyn to parse your C# into syntax trees, apply transformations, and write back valid code. There's no AI involved, no randomness. If it hits something ambiguous, it drops a TODO comment and moves on.

NetLift at a glance

  • Roslyn-based code transformation, no AI
  • Migrates MVC 5, EF6, WCF, SignalR to modern .NET 8+
  • 1,819 tests, confidence scoring on every transformation
  • Dual-licensed: AGPL-3.0 for open source, commercial license for proprietary use
  • 3 public migration PRs you can review line by line

01 Why I built this

Manual migration is repetitive work. You're updating namespaces from System.Web.Mvc to Microsoft.AspNetCore.Mvc, rewriting DbContext constructors to use dependency injection, converting web.config XML to appsettings.json. It's mechanical. Tedious. A waste of time.

Upgrade Assistant is good for project files. It converts .csproj to SDK-style, updates package references, fixes TFM. But it stops there. Your actual C# code? Still .NET Framework syntax. Your EF6 queries? Still using DbSet.Include() patterns that don't exist in EF Core.

Migration is also a good time to fix architectural debt. But doing both manual migration and architectural cleanup at the same time gets messy fast.

I wanted something that handles the mechanical parts so I could focus on actual decisions. NetLift does the rote transformations and gives you a clean starting point.

02 How NetLift works

NetLift uses Roslyn to parse C# into syntax trees, transform them, and write back valid code. Deterministic code analysis, not AI.

Same input, same output. No randomness. When NetLift runs into an edge case or ambiguous pattern, it adds a // TODO: NetLift comment instead of guessing. You make the final call.

Three commands

1. Analyze

Scans your codebase and reports what needs migration. No changes made yet.

netlift analyze --path ./YourSolution.sln --report analysis.json

2. Migrate

Migrates .NET Framework to .NET 8+. Project files, namespaces, MVC controllers, EF6, WCF, Razor views.

netlift migrate --path ./YourSolution.sln --dry-run
netlift migrate --path ./YourSolution.sln

3. Modernize

Applies architectural patterns: CQRS with MediatR, FluentValidation, Result types, controller slimming.

netlift modernize --path ./YourSolution.sln --patterns cqrs,validation

Pro tip: Always use --dry-run first. It shows you what would change without touching your code. Review the diff, then run without the flag.

03 What gets migrated

NetLift handles the full migration surface. Here's what it transforms, organized by migration vs modernization:

NetLift migration output showing automated code transformation from .NET Framework to .NET 8
NetLift analyze output on a real solution
NetLift detailed migration report with confidence scoring per file
Detailed per-file migration report with confidence scores

Migration

  • Project structure

    SDK-style .csproj, packages.config to PackageReference

  • Configuration

    web.config to appsettings.json, Program.cs bootstrapping

  • ASP.NET MVC

    Controllers, ActionResults, filters, HttpContext, routing

  • Razor Views

    Html.ActionLink to Tag Helpers, 46+ helper patterns

  • Entity Framework

    DbContext, Fluent API, Include/ThenInclude patterns

  • Static Files

    Content/Scripts folders to wwwroot

  • SignalR

    Hub migration, client connection updates

  • WCF to gRPC/REST

    Service contracts, data contracts, bindings

  • DI Container analysis

    Autofac/Unity to Microsoft.Extensions.DI

Modernization

  • CQRS with MediatR

    Extract commands, queries, handlers from controllers

  • Controller slimming

    Move business logic to handlers, keep controllers thin

  • FluentValidation

    Convert data annotations to FluentValidation rules

  • Result types

    Replace exceptions with Result<T> pattern

  • Logging patterns

    Structured logging with ILogger, log scopes

  • Repository pattern

    Extract data access behind interfaces

  • Unit of Work

    Transaction management, DbContext lifetime

04 Real migrations you can review

I ran NetLift on three public .NET Framework projects and opened PRs with the full migration diff. Every PR is public, you can review every line. This is what the tool actually produces.

ContosoUniversity

View PR

Academic sample app with students, courses, and enrollments. Small codebase but covers all the basics: MVC controllers, EF6 with navigation properties, Razor views with forms.

MVC 5 → ASP.NET CoreEF6 → EF Core 8Razor Tag Helpers

MvcMusicStore

View PR

E-commerce app with shopping cart, checkout flow, and user authentication. Shows CQRS modernization on top of migration. Fat controllers slimmed down to handlers.

CQRS + MediatRShopping Cart LogicAuth Migration

eShopModernizing

View PR

Microsoft's reference e-commerce app. Multi-project solution with catalog management, ordering system, and admin panels. The most complex example with cross-cutting concerns.

Multi-project SolutionCatalog SystemCross-cutting Patterns

Unedited diffs. Click through to GitHub and see what you get, including the spots where NetLift flagged something for manual review.

05 Confidence scoring

Every transformation gets a confidence score. When the tool isn't sure about something, it says so. No silent failures.

ConfidenceActionExplanation
95-100%Auto-applied, safe mechanical changeNamespace updates, using statements, simple syntax changes. These always work.
80-94%Applied + INFO comment, worth a glanceController actions, EF queries, Razor helpers. Likely correct, but review the context.
60-79%Applied + TODO comment, needs human reviewComplex EF includes, custom filters, ambiguous patterns. Change is made, but verify it.
<60%Skipped, manual taskEdge cases, custom implementations, framework extensions. Too risky to guess.

Why this matters

You need to be able to trust migration tooling. If a tool silently produces broken code, you find out at runtime. NetLift is explicit about what it's unsure of.

The TODO comments are probably the most useful part. They mark spots where NetLift made a change but wants you to double-check it actually matches what you intended.

06 Limitations

NetLift doesn't support WebForms, WPF, or WinForms. Their architectures are different enough that automated migration would produce code that compiles but doesn't really work.

WebForms relies on ViewState, server controls, and page lifecycle events. You can't mechanically convert that to Razor Pages. Same story with WPF and XAML binding - there's no straightforward mapping to ASP.NET Core or Blazor.

For WPF apps specifically, I wrote a separate guide on WPF modernization strategies. The short version: rewrite or containerize. Automated migration isn't the answer.

What NetLift does support

  • ASP.NET MVC 5 (controllers, views, routing)
  • Entity Framework 6 (DbContext, queries, migrations)
  • WCF services (convert to gRPC or REST APIs)
  • SignalR (hub migration to ASP.NET Core SignalR)
  • Web APIs (ASP.NET Web API to ASP.NET Core APIs)

What NetLift does NOT support

  • ASP.NET WebForms (page lifecycle, ViewState, server controls)
  • WPF desktop apps (XAML, MVVM, commanding)
  • WinForms desktop apps (Form Designer, event handlers)

07 Getting started

NetLift is on GitHub. Clone it, build it, run it on your codebase. It has 1,819 tests covering transformation patterns and edge cases.

Quick start

# Clone the repository
git clone https://github.com/wojciechowskiapp/NetLift.git
cd NetLift

# Build the tool
dotnet build --configuration Release

# Run on your solution
dotnet run --project NetLift.CLI -- analyze --path ./YourSolution.sln
dotnet run --project NetLift.CLI -- migrate --path ./YourSolution.sln --dry-run

Supports .NET 8+. Tested on Windows, Linux, and macOS. CI pipeline runs 1,819 tests on every commit.

License

Dual-licensed: AGPL-3.0 for open source, commercial license for proprietary use. Contact for pricing.

Test coverage

1,819 unit and integration tests. Every transformation pattern has test cases. Edge cases, regressions, confidence scoring.

Try it or get in touch

NetLift is open source. Try it on your codebase, or reach out if you need help with a migration project.

Frequently asked questions

What is NetLift?

NetLift is a Roslyn-based tool for automated .NET Framework to .NET 8+ migration. It goes beyond project file updates and actually rewrites C# code, Razor views, Entity Framework queries, and WCF services. It's deterministic: same input always produces the same output.

How does NetLift differ from .NET Upgrade Assistant?

While .NET Upgrade Assistant handles project files, package references, and TFM updates, NetLift actually rewrites your C# code. It transforms MVC controllers to minimal APIs, EF6 DbContext to EF Core, Razor Html helpers to Tag Helpers, and WCF services to gRPC or REST. It also offers modernization patterns like CQRS with MediatR.

Is NetLift AI-based?

No. NetLift uses purely Roslyn syntax analysis and deterministic code transformations. There's no AI, no language models, no randomness. Same input always produces the same output. When NetLift isn't sure about a transformation, it adds a TODO comment instead of guessing.

What .NET applications can NetLift migrate?

NetLift supports ASP.NET MVC 5, Entity Framework 6, WCF services, and SignalR apps. It does NOT support WebForms, WPF, or WinForms. These have fundamentally different architectures where automated migration would produce code that compiles but misses the point.

Is NetLift free?

NetLift is dual-licensed. AGPL-3.0 if you're fine with open-sourcing your project, commercial license if you need it for proprietary work. The code is fully open source with 1,819 tests on GitHub.

References

  1. [1] NetLift GitHub Repository -https://github.com/wojciechowskiapp/NetLift
  2. [2] ContosoUniversity Migration PR -https://github.com/wojciechowskiapp/ContosoUniversity.LegacyMigration/pull/2
  3. [3] MvcMusicStore Migration PR -https://github.com/wojciechowskiapp/MvcMusicStore.LegacyMigration/pull/2
  4. [4] eShopModernizing Migration PR -https://github.com/wojciechowskiapp/eShopModernizing.LegacyMigration/pull/2
  5. [5] Microsoft Roslyn SDK -https://learn.microsoft.com/en-us/dotnet/csharp/roslyn-sdk/
  6. [6] .NET Upgrade Assistant -https://dotnet.microsoft.com/en-us/platform/upgrade-assistant
  7. [7] gRPC for .NET -https://learn.microsoft.com/en-us/aspnet/core/grpc/
  8. [8] Entity Framework Core Migration Guide -https://learn.microsoft.com/en-us/ef/core/what-is-new/ef-core-8.0/whatsnew
  9. [9] ASP.NET Core Tag Helpers -https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/intro
NetLift: Automated .NET Framework Migration Tool - Case Study | Wojciechowski.app