5 Things You Should Know Before Moving an App from .NET Framework to .NET Core

Since its release back in 2016, .NET Core has attracted a lot of attention across businesses and CTOs. It was marketed as an open-source software framework that works on Windows, Linux, and macOS as well as facilitates cross-platform development.

Although .NET Core was not presented as a successor of the .NET Framework, they are often compared. There has been no obvious leader since the .NET Framework’s last update in 2019, which is why the question of migration arises. Should your company launch the transition from .NET Framework to .NET Core? According to the 2019 Stack Overflow survey, .NET Core scored first place in the category “Favorite Framework, Libraries, and Tools with 77.2%”. But what are the main challenges of migration, and what should you know before even considering it?

Why Is Migration from .NET Framework to .NET Core Relevant?

Why update .NET Framework to .NET Core if Microsoft keeps .NET Framework afloat and is not planning on terminating new releases and technical support? Does it bring benefits that justify spending time and money on the complex transition process? Has .NET Framework become a legacy system that needs to be moved from, or does it still offer something beneficial? 

  • Unlike .NET Framework, .NET Core offers portability or, in other words, the ability to develop and deploy using any operating system — Windows, macOS, or Linux;
  • .NET Core offers higher performance as many businesses reported after going through the transition from .NET Framework;
  • .NET Core ensures simpler package management, allowing developers to save a significant amount of time working with NuGet packages.

However, they are not that different and have many features in common. The best approach is to start migrating from the .NET Framework to .NET Core gradually and step-by-step. There is no immediate rush to move to .NET Core, but it does look like this framework is the future.

The comparison table: .NET Framework vs .NET Core

The comparison table: .NET Framework vs .NET Core | ModLogix

The bottom line is that migration from the .NET Framework to .NET Core does not always make sense. Especially it becomes counterproductive when your application depends on libraries and packages that are not supported by .NET Core. If your application’s functionality is stable with the legacy technology, there is no need in force-migrating to the new technology that might destabilize the system. However, if the migration is relevant to achieve your business goals and needs, it is possible to mitigate technical difficulties and execute the shift. 

What You Should Know Before Moving from .NET Framework to .NET Core

Due to the complexity of moving from the .NET Framework to the .NET Core, there are a number of things you should know before the migration. Our short but comprehensive guide is based on experience with our projects and first-hand information collected by businesses who successfully transitioned.

Migrate from ASP.NET MVC

Since this migration is the easiest step, many companies choose to start with it. Thanks to thorough Microsoft documentation, you can relatively quickly and easily execute this step. Begin by creating a new .NET Core project. Then migrate startup and initialization, content and configurations, views and actions. 

There are two ways of performing this task — manual or automated. Both have their own benefits; for example, automation saves time, whereas a manual approach will give you a chance to review the contents and save money on an automation tool. You simply open two instances of Visual Studio simultaneously, copy and paste the content, and make changes if necessary on the go.

Analyze NuGet dependencies

At first, analyze your NuGet dependencies by moving your project to PackageReference format. Then visit nuget.org to check the compatibility of the dependencies. Another way to analyze the compatibility is to use the NuGet Package Explorer tool. It contains sufficient information about each NuGet dependency. 

In case you discover NuGet dependencies that are not compatible with .NET Core, there are some approaches you can take to proceed with the migration: 

  • Contact developers and ask them for support. Remember that .NET Core is open-source and developers are volunteers, which is why you should be mindful of their time and efforts;
  • Visit nuget.org and search for a package that fulfills similar functionality as the one you are using now;
  • If possible, try to write a code that will accomplish the same tasks as the package itself. 
  • New versions keep being released; therefore, you can simply wait until the day of the release and not use some app functionality until then. Contact the .NET team to let them know which library you would like to use.

Migrate from WebForms

Microsoft prepared very comprehensive documentation for migration to .NET Core. However, you will not find anything concerning WebForms. It is not a mistake — WebForms are not supported by .NET Core. 

This is why the process of moving WebForms is called porting from .NET Framework to .NET Core. Since it implies a complete re-implementation and shift of basic development paradigms, the process of porting is truly complex and long. There are two main approaches:

  • You can start from scratch and write a whole new system, which takes a lot of effort, time, and resources. Since every change to the existing system needs to be duplicated in the new version, the process of rewriting slows down the work. 
  • Or you can gradually migrate the system page by page by rebuilding the entire core library and migrating every page one by one. For this, you would have to run two core libraries simultaneously. 

Technologies that are not supported by .NET Core

There are three technologies that are fully not supported by .NET Core, although it does not mean that they will not be supported in the future. 

  • Application domains. Application domains are used to separate applications from each other and come at a big price tag. Since there is no such option to make additional app domains, you should create isolated processes instead. 
  • Remoting. .NET remoting is not supported on .NET Core because they exist to ease the communication between app domains which cannot be used here, as mentioned before. Additionally, the remoting feature is also quite expensive and needs more runtime support. We recommend using inter-process communication as an alternative. 
  • Code access security (CAS). Using CAS on .NET Core makes the transition process more complicated and does not ensure a great deal of security. Instead, consider using security boundaries that your operating system offers. 
  • LINQ2SQL. Being a .NET Framework component, LINQ to SQL cannot be adopted by .NET Core. Its main objective is to provide a run-time infrastructure that allows to translate queries into SQL and send them to the database. The database runs the application and LINQ2SQL translates the data back to objects. 

Mitigate future risks

Although it is extremely difficult to move WebForms to .NET Core, this technology is being widely used by many businesses. If you are one of the developers who still uses WebForms and thus cannot easily migrate to .NET Core, there are some options for you to minimize the work in the future:

  1. Implementation of Model Binding

If you are planning to migrate from .NET Framework to .NET Core in the future and would like to simplify the processes, adopt the model binding feature. 

  1. APIs and client-side development

Build applications using more APIs and be more client-oriented by switching to frameworks like Angular and React that are less dependent on WebForms and easier to move. 

  1. Create .NET standard libraries

These libraries let you know whether your code can be used on both .NET Framework and .NET Core which will help you move your code.

How to prepare your legacy system for .NETFramework to .NET Core migration | ModLogix

Our Experience

ModLogix is a company that specializes in legacy software modernization. We know everything there is to know about outdated technology, its limitations, and how to modernize it. 

Migration from ASP.NET MVC to .NET Core

AA is a SaaS-based platform designed to monitor changes in Medicare, Medicaid, and Health maintenance organization (HMO). AA helps healthcare organizations avoid billing errors and reduce collection times. 

AA faced a typical problem every business with legacy applications face — the lack of IT talents for further maintenance. This is why they decided to switch from .NET Framework to .NET Core and contacted us. 

What did we do?

  1. The ModLogix team performed an analysis with an intention to divide NuGet packages into two groups: the .NET Core supported and not supported ones; 
  2. Our engineers prepared for the framework migration of technologies like Membership Provider and Dependency Injection.
  3. Since AA used MvcSiteMapProvider plugin for app navigation that is not supported by .NET Core 3.1, our team created a unique solution to this problem that perfectly meets the client’s needs. 
  4. ModLogix knows the value of clear code, which is why our developers streamlined unused and duplicate plugins. 
  5. We have also updated the storage structure to fit the new .NET requirements. First, we moved the components to the new platform. Later, we reorganized and separated Bootstrap and Metronic frameworks from custom CSS styles, JS scripts, jQuery plugins, etc.
Get Free Code assessment

Identify modernization and security improvements for your product

Learn more

The client’s gain

The client adopted the newest framework .NET Core 3.1, which offers long-term support and smooth future migration. Additionally, AA managed to reduce per-transaction cost by more than 300% and increase performance exponentially. The AA system is far more secure and stable than before. Finally, AA executives predict a positive ROI as an outcome of this migration project within the next six months. 

Read the full case study about migration from ASP.NET MVC to .NET Core 3.1 for AA.

If your company experiences similar problems with legacy software, contact ModLogix experts to receive the best application modernization services. We have worked with many businesses, languages, technologies, frameworks, and we are ready to bring your outdated system to a new level.

Contact our modernization experts to receive a consultation and ask any questions concerning how to migrate from .NET Framework to .NET Core.

Final Thoughts

Since Microsoft’s announcement, it has become clear that .NET Core is the future. It offers many new native features, increases performance, and has a bigger community. Although there are some cases where you should not rush into the transition such as having applications that are tightly integrated with the Windows operating system, look into the migration to ensure your business keeps up with the newest trends. 

There is no ideal scenario of going about migrating to .NET Core, which is why you should contact specialists to discuss your migration strategy and let them steer you in the right direction. 

Latest Blog Posts

Ask Us Any Question

* Please enter your name
* Please leave a message

    How to protect your business from getting obsolete?

    Download the white paper to discover hands-on approaches to aging software and mainframes.

    Get Your FREE Template!

    Please, provide the email address so that we can send the whitepaper to you.

    * Please enter your name

      Get Your FREE Template!

      Please, provide the email address so that we can send the whitepaper to you.

      * Please enter your name