DZone
Cloud Zone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
  • Refcardz
  • Trend Reports
  • Webinars
  • Zones
  • |
    • Agile
    • AI
    • Big Data
    • Cloud
    • Database
    • DevOps
    • Integration
    • IoT
    • Java
    • Microservices
    • Open Source
    • Performance
    • Security
    • Web Dev
DZone > Cloud Zone > Modernizing a Legacy Microsoft .NET Application by Upgrading It to the Latest Microsoft .NET Core Framework

Modernizing a Legacy Microsoft .NET Application by Upgrading It to the Latest Microsoft .NET Core Framework

Migrating from .NET Framework to .NET Core is a strategic decision that involves cost, timing, skills, and changes to the code of application. Read more here.

Abhishek Shukla user avatar by
Abhishek Shukla
·
Feb. 14, 22 · Cloud Zone · Analysis
Like (3)
Save
Tweet
4.49K Views

Join the DZone community and get the full member experience.

Join For Free

Business Statement

Recently I was working as a cloud migration architect to migrate several on-premise applications to Microsoft Azure Cloud. During the portfolio analysis, we found that many of the on-premise applications were created long ago by using very initial versions of the Microsoft .NET Framework.

The frameworks in these applications were already at the end of their lifecycles and it would not be easy to get any support for those frameworks. These frameworks were also not supported on Azure Platform as Service (PaaS) offerings.

Options To Migrate Application to Cloud

Based on the 7 Rs strategy, there are many options available to move an existing application to the Cloud. The below diagram suggests a few of them for reference.

7 R strategies for cloud migration

7 R strategies for cloud migration

Decision Tree for migrating .NET workloads

( Above image is taken from the AWS blog and has been modified for Microsoft Azure. Any credit for the image is with the original publisher.)

We can see that following the “Rehosting” path for the existing application is the easiest choice to move the existing application to the Cloud, but it does have limitations. Rehosting (a.k.a “Lift and Shift”) is only supported by leveraging the IaaS (Azure VM) offering of the Cloud and this also limits the utilization of the PaaS offering of Microsoft Azure (Azure Web app, Containerization, Auto Scaling, etc.) as well as any future enhancement of the application. This also limits the use of any feature offered by the latest Microsoft .NET Core Framework.

What Is .NET Core?

.NET Core is a new version of the .NET Framework, which is a free, open-source, general-purpose development platform maintained by Microsoft. It is a cross-platform framework, so if your application needs to run on multiple platforms apart from windows, then .NET core is the go-to platform as it is compatible across Windows, Linux, and Mac operating systems.

Microsoft .NET Core Features

How To Upgrade To .NET Core

Upgrading any Microsoft .NET Framework to .NET Core is a process. In the below diagram, we can see that this process involves four main steps:

  1. Starts from the analysis of the existing code
  2. Upgrading the project files to .NET Core files
  3. Fixing the issues related to coding
  4. Testing the application for target .NET Core version

Steps to Upgrade to .NET CoreStep 1: Analysis of Existing Code

This step involves the analysis of the existing code base to find the portability compatibility for the .NET Core Framework.

There are a few .NET technologies that are not available or compatible with .NET Core.

  • Windows Specific APIs: If your application is designed to work with the Windows Registry or WMI, it won’t be possible with .NET Core since Core is considered to be isolated from the underlying OS.
  • Language support: Even though VB and F# are said to be compatible with .NET Core, there are a few project types that do not support them.
  • Workflow-related services: Workflow Services and Data Services are only available with .NET Framework.
  • Web Forms: ASP.NET Web Forms are only available in the .NET Framework.
  • Web Pages: ASP.NET web pages are left out from .NET Core.

.NET Portability Analyzer

Analysis of existing code is done through Microsoft .NET Portability Analyzer. This tool can be accessed from Visual Studio 2019. After installing it, you can configure the various analysis parameters and output format for the generated reports.

The tool will help to specify the target .NET Core Framework(s).

.NET Portability AnalyzerPortability Summary

Summary reports give the portability percentage for each assembly included in the analysis. In the below diagram, we can see that included assembly svcutil is 71.24% compatible with .NET Core + Platform Extensions.

Portability Summary

Details 

The Details section of the report lists the APIs missing from any of the selected Targeted Platforms.

Portability Summary Details

Missing Assemblies

Any assemblies that are missed and not being analyzed will be presented in the missing assembly section.

Missing Assemblies

Step 2: Upgrade the Code

In this step, you need to convert the existing project files, solution files and NuGet packages as the latest .NET Core Framework. Depending on the project size, this process can be time consuming process. 

.NET Upgrade Assistant Tool

The .NET Upgrade Assistant is a command-line tool that can be run on different kinds of .NET Framework apps. This toll will help to upgrade .NET Framework apps to .NET 6. After running the tool, in most cases the app will require additional effort to complete the migration. The tool includes the installation of analyzers that can assist with completing the migration. 

Step 3: Build the Code Using Visual Studio IDE 

After the execution of .NET upgrade assistant tool, you will get a partially modified code for latest .NET Core Framework. You need to open this code in your preferred visual studio IDE or visual studio code to manually fix the remaining issues.

Based on the project type, these remaining issues may be different. 

Step 4: Test the Code

At this step, you will have a code that is error free and successfully getting build in visual studio IDE. Now you need to execute the code for testing in target framework and environment.

Conclusion 

Migrating from .NET Framework to .NET Core is a strategic decision. This involves cost, timing, skills, and changes to the code of application. Any such decision must be reviewed by respective stakeholders before making such a decision.

.NET application Framework azure

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Is DataOps the Future of the Modern Data Stack?
  • Modern Application Security Requires Defense in Depth
  • Practice on Pushing Messages to Devices of Different Manufacturers
  • Vaadin Apps as Native Executables Using Quarkus Native

Comments

Cloud Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • MVB Program
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends:

DZone.com is powered by 

AnswerHub logo