Friday, October 12, 2018

How to choose between .NET Framework and .NET Core for server apps




Introduction
DevOps is rapidly transform in last few years, There was a time when people used to code on VB 6 to create EXE that will used on Win XP to check if .NET framework is installed, Now a days we travel from .NET 1.0 to 4.5.x and Now .NET Core. 
.NET structure, CLR, MSIL has changed a lot over years, .NET is not limited to only Windows or specific version of OS, it has improved a lot and supporting modern features like Cross platform, Microservices, Docker container, Mobility, Cloud computing and reliability, But the question remain same, When to choose .NET Framework and When to choose .NET Core, Lets walk through this article, it will help you to choose between .NET Framework and .Net Core for server Apps.
Preparation
If you want to develop web based applications/web apps then there exist two strong foundations from which you can either use .NET framework or .NET Core, No doubt, both are having many similar components but there exist some fundamentals difference too. Depending on your requirement and nature of application you can choose either of them.
When to choose .NET Framework
The one-liner answer for this question is "You need to choose it, when .NET Core not able to replace .NET framework in all server applications and its related component"
1.     If you are having existing application in .NET framework and want to develop some new part in .NET Core then Don't try it, instead of Using .NET Core, just create a separate addon (in .NET Core) and call it from .NET Framework (e.g. Microservices using .NET Core)
2.     There are much chances that you are using any 3rd Party DLL which is in .NET framework but not available in .NET Core, then you should go with .NET framework only
3.     If there are any .NET framework technologies that are not available in .NET Core then do not go for .NET Core, Here is the list of .NET framework common technologies that are not available in .NET Core
1.     WCF Services implementation : You cannot consume WCF services from ASP.NET Core, but may be in the future they will consider it.
2.     WWF  (Windows work flow foundation) is also not available in .NET Core.
3.     ASP.NET Webforms : There are no web forms exist in .NET Core and might be there is no future plan too.
4.     Limited Languages support : VB (Visual Basic) and F# are currently there in .NET Core but not supported by all project types.
5.     ASP.NET Web pages are also example of it.
But Microsoft are working on those things and trying to fetch as many things in .NET Core as they can, you can check the list here
When to choose .NET Core

This is the brand new .NET technology with different base structure than .NET, no doubt, it is not having that much classes and libraries that support in .NET framework, but it is faster and modular than .NET Framework
1.     If you want to run your application on multiple platforms then you can go with it, .Net Core supports all popular platforms like Windows, Mac, Linux, Cross platform is the biggest advantage of .NET Core
2.     If you want to develop application on MACOs  or Linux then you can go with .NET Core, as you can do it using Visual Studio code (Which is open source and free, visit Code.Visualstudio.com for more details) , Additionally there are some third party editors available for it.
3.     When you want to use Microservices then you can choose .NET Core. (In Micro services we break down large project in smaller independent runnable modules, these modules are communicated with each other via API calling) This will also help us to mix different technologies in single project (Like we can mix Java, ruby, .NET Framework)
4.     You can use .NET Core, when you need scalability with good performance. .NET core is faster than .NET framework, it helps to reduced server and VM cost, it loads with minimum set of libraries that are really needed.
5.     .NET Core has seamless support to Containers, .NET Core can be used with different design patterns and microservices. ASP.NET Core is cross platform it is much easier to deploy docker containers in .NET Core  than in .NET framework.
6.     .NET Core allows you to installed different version of .NET Core on same machine, so that you can run .NET Core application side by side that targeted to their specific installed .NET Core versions

Finally
Developers are very curious about learning and implementing  .NET Core but there are some pros and cons to it. If you are running large enterprise application that built on .NET Framework  do not try to migrate it, Consider your requirement first and then proceed.
              Technologies are introduced and enhanced to overcome earlier technology problems, but some where we need decide to move on or not. Here time, cost, resources and need are the four factors affecting to take this decision. Finally it's your choice that what you want to accomplish

 Thanks
koolprasad2003