.NET Core is the future. For developers who want to know why and how they can migrate .NET Framework to .NET Core and what’s buzzing in .NET Core space, you are at the right place. In this post we could see, why do you need to port to .NET Core or stay with .NET Framework? Major components of both framework, when to use .NET Core? Why at some points you may not use .NET Core?
Traditionally .NET Framework ran only on Windows devices. The Mono and Xamarin projects helped with cross platform support into mobile devices, iOS and Linux. The .NET Core is the answer to this problem. The three major components of .NET architecture are,
- Common Language Specification – CLS
- Framework Class Library – FCL
- Common Language Runtime – CLR
Microsoft has both .NET Framework runtime and .NET Core runtime in parallel and the overlapping APIs are called as .NET Standard. Developers used .NET Framework apps for various desktop and web based app development which ran on windows. Whereas with .NET Core can be used to create server apps that runs on Windows, Linux and Mac. Typically the preferred language for .NET Core is C#. It is an object oriented language similar to C and C++ language style.
When should you choose .NET Core? If you need a cross-platform and open-source framework that should run on any platform and preferably cloud applications of large enterprises using Microservices go for it. This will fulfil your cross-platform needs, the new form of service-oriented architecture SOA called Microservices support, when Docker containers are used, when you will need high performance with scalable apps and the very important aspect is that if you need to run multiple versions of .NET side by side.
When should you NOT use .NET Core? When the rich features of .NET Framework is not available yet in .NET Core versions, Full support of WPF is not yet available, when any third party libraries have old dependencies with .NET Framework and can’t be updated, When you need Enterprise library support etc.
Developers should choose to stay with .NET Framework, why? If you are using .NET workflow, you extensively use networking, type-safe, memory-safe, legacy apps. If Docker and Contanier are not feasible for your ecosystem. Or any platform that doesn’t support .NET Core. And use it when .NET Core works, if you are building a new app, you would need high performance and scale and reduce cost simultaneously.
Tutorial to port from .NET Framework to .Net Core: Find out all the dependent frameworks, libraries that are in your current project. Check if they support .NET Core upgrade or they have compatible libraries in .NET Core. Verify all NuGet package dependencies and target .NET Standard where ever necessary. Re-target all projects to support minimum .NET 4.6.2 Framework. And finally perform extensive testing after successful porting. Cheers!