Porting from .NET Framework to Modern .NET

Learn about considerations for porting .NET Framework applications to modern .NET, including suitable application types and potential benefits.

If we are an existing .NET Framework developer, we may have existing applications we think we should port to modern .NET. But we should carefully consider if porting is the right choice for our code because sometimes, the best choice is not to port.

For example, we might have a complex website project that runs on .NET Framework 4.8 but is only visited by a few users. If it works and handles the visitor traffic on minimal hardware, potentially spending months porting it to a modern .NET platform could be a waste of time. But if the website currently requires many expensive Windows servers, then the cost of porting could eventually pay off if we can migrate to fewer, less costly Linux servers.

The possibility of port

Modern .NET has great support for the following types of applications on Windows, macOS, and Linux, so they are good candidates for porting:

  • ASP.NET Core websites, including Razor Pages and MVC

  • ASP.NET Core web services (REST/HTTP), including Web APIs, Minimal APIs, and OData

  • ASP.NET Core-hosted services, including gRPC, GraphQL, and SignalR

  • Console App command-line interfaces

Modern .NET has decent support for the following types of applications on Windows, so they are potential candidates for porting:

  • Windows Forms applications

  • Windows Presentation Foundation (WPF) applications

Modern .NET has good support for the following types of applications on cross-platform desktop and mobile devices:

  • Xamarin apps for mobile iOS and Android

  • .NET MAUI for desktop Windows and macOS or mobile iOS and Android

Modern .NET does not support the following types of legacy Microsoft projects:

  • ASP.NET Web Forms websites. These might be best reimplemented using ASP.NET Core RazorPages or Blazor.

  • Windows Communication Foundation (WCF) services (but there is an open-source project named CoreWCF that we might be able to use depending on requirements). WCF services might be better reimplemented using ASP.NET Core gRPC services.

  • Silverlight applications. These might be best reimplemented using Blazor or .NET MAUI.

Silverlight and ASP.NET, Web Forms applications, will never be able to be ported to modern .NET, but existing Windows Forms and WPF applications could be ported to .NET on Windows to benefit from the new APIs and faster performance. Legacy ASP.NET MVC web applications and ASP.NET Web API web services currently on .NET Framework could be ported to modern .NET and then hosted on Windows, Linux, or macOS.

The need to port

Even if we could port, should we? What benefits do we gain? Some common benefits include the following:

  • Deployment to Linux, Docker, or Kubernetes for websites and web services: These OSes are lightweight and cost-effective as websites and web service platforms, especially compared to the more costly Windows Server.

Get hands-on with 1400+ tech skills courses.