Introduction
DevOps has rapidly transformed in last few years. There was a time when people used to code on VB 6 to create EXE that will be 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 the 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 remains the same, When to choose .NET Framework and When to choose .NET Core. Let's 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 is not able to replace .NET framework in all server applications and its related component."
- If you are having an 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 the .NET Framework (e.g., Microservices using .NET Core).
- There is a high chance 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.
- 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.
- WCF Services implementation: You cannot consume WCF services from ASP.NET Core, but may be in the future, they will consider it.
- WWF (Windows work flow foundation) is also not available in .NET Core.
- ASP.NET Webforms: There are no web forms that exist in .NET Core and might be there is no future plan too.
- Limited Languages support: VB (Visual Basic) and F# are currently there in .NET Core but not supported by all project types.
- ASP.NET Web pages are also examples of it.
But Microsoft is 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 many classes and libraries that support in .NET framework, but it is faster and modular than .NET Framework
- 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.
- 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.
- When you want to use Microservices, then you can choose .NET Core. (In Micro services, we break down a large project in smaller independent runnable modules, these modules communicate with each other via API calling). This will also help us to mix different technologies in a single project (like we can mix Java, Ruby, .NET Framework)
- 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.
- .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.
- .NET Core allows you to install a different version of .NET Core on the same machine, so that you can run .NET Core application side by side that is targeted to their specific installed .NET Core versions.
Points of Interest
Developers are very curious about learning and implementing .NET Core but there are some pros and cons to it. If you are running a large enterprise application that built on .NET Framework, do not try to migrate it. Consider your requirement first and then proceed.
Finally
Technologies are introduced and enhanced to overcome earlier technology problems, but somewhere we need to decide whether 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 what you want to accomplish.
Thanks for reading!