.NET Framework Vs .NET Core Vs .NET Standard

Introduction

In this article, we are going to explore about the differences between .NET Framework, .NET Core, and .NET Standard.

.NET Framework vs .NET Core
 

  .NET Framework .NET Core
 History  The .NET Framework is the first implementation of .NET.  .NET Core is the latest implementation of .NET.
 Open Source  Certain components of the .NET Framework are open source.  .NET Core is open-source.
 Cross-Platform  It works only on the Windows platform. This does not support cross-platform deployment.  It runs cross-platform like Windows, Linux, and macOS.
 Third-party packages Support  There are many third-party packages, libraries are available.  The .NET Core also has support for a large number of third-party packages, but still, it doesn’t compete with .NET Framework.
 In-app deployment  It doesn’t support the in-app deployment model.  It does support an in-app deployment model.
 Performance and Scalability  .NET Framework is less effective in comparison to .NET Core in terms of performance and scalability of applications.  .NET Core offers high performance and scalability compared to .NET Framework.
 Micro-Services Implementation  .NET Framework does not support the implementation of micro-services.  .NET Core supports the implementation of micro-services
 REST Services Implementation  It supports the REST API services implementation.  We can create a REST API using .NET Core.
 Command-line Tools  .NET Core provides lightweight editors and command-line tools for all supported platforms.  .NET Framework is heavy for Command Line Interface
 When to use
  • Our application runs on only Windows platform.
  • Our application is based on WinForms or WPF applications.
  • ASP.NET Web Forms creation.
  • If you want to create a WCF service.
  • Our application uses some third-party packages which are not supported by .NET Core.
  • The application uses .NET technologies that are not available for .NET Core.
  • If your application want to access Windows specific APIs then choose .NET Framework.
  • To create cross platform application.
  • To create Microservices, then definitely go with .NET Core.
  • To deploy an application to Dockers containers.
  • To create high-performance and scalable applications.
  • If you are running multiple .NET versions side-by-side the chose .NET Core.
  • If you want a command line interface (CLI) control then .NET core is the best option.
 When not to use
  • When running across OS platforms is a requirement for your application. 
  • If you want to implement the microservices.
  • Web applications that require the best possible performance and scalability 
  • ASP.NET WebForms don’t exist in .NET Core.
  • If you want to create a WCF service.
  • If your application wants to access Windows-specific APIs.
  • If your application needs to work with the Windows Registry, WMI, or other Windows specific APIs then it won’t work with .NET Core.


.NET Standard

Let 'sconsider we have created an application using .NET Framework and used some shared libraries (which are developed by .NET Framework). After some time, we have decided to create an application in .NET Core and try to re-use the above same shared library. Is it compatible and can we use it? The Answer is NO. We cannot use .NET Framework Base Class Library in .NET Core applications, because of compatibility issues. Basically, the libraries which target to .NET Framework can only run in .NET Framework-based applications and the libraries which target to .NET Core can only run in .NET Core compatible applications.

What is the solution?

The solution is .NET Standard. .NET Standard is a specification of the set of APIs which is compatible with any .NET platforms (which is either .NET Framework or .NET Core). If we create the Base Class Library using .NET Standard, then it will run with any .NET Runtimes. So, if you want to create a shared library that is going to be re-use later then you choose .NET Standard because it is portable with .NET Framework, .NET Core, and Xamarin as well.

Each .NET Standard version contains some set of APIs like System.Data, System.Collections Etc. If a new version of the .NET Standard is introduced then it contains all the previous version sets of APIs as well as some of the new APIs. A higher version of the .NET Standard means more APIs available. 

.NET Standard is,

  • It is not a framework like .NET Framework or .NET Core.
  • This is the set of fundamental APIs that all .NET implementations must implement
  • Use for code sharing and reuse the codes between different runtimes.
  • Compatible with any .NET application.

.NET Standard supports a wide range of Framework, which are listed in the below table.

https://docs.microsoft.com/en-us/dotnet/standard/net-standard

.NET Standard 1.0 1.1 1.2 1.3 1.4 1.5 1.6 2.0 2.1
.NET 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0 5.0
.NET Core 1.0 1.0 1.0 1.0 1.0 1.0 1.0 2.0 3.0
.NET Framework 1 4.5 4.5 4.5.1 4.6 4.6.1 4.6.1 2 4.6.1 2 4.6.1 2 N/A3
Mono 4.6 4.6 4.6 4.6 4.6 4.6 4.6 5.4 6.4
Xamarin.iOS 10.0 10.0 10.0 10.0 10.0 10.0 10.0 10.14 12.16
Xamarin.Mac 3.0 3.0 3.0 3.0 3.0 3.0 3.0 3.8 5.16
Xamarin.Android 7.0 7.0 7.0 7.0 7.0 7.0 7.0 8.0 10.0
Universal Windows Platform 10.0 10.0 10.0 10.0 10.0 10.0.16299 10.0.16299 10.0.16299 TBD
Unity 2018.1 2018.1 2018.1 2018.1 2018.1 2018.1 2018.1 2018.1 2021.2.0b6


Summary

  • .NET Framework is mainly used for Windows-based applications development which is less effective in comparison to .NET Core.
  • .NET Core is open-source and used to develop cross-platform applications and micro-services.
  • .NET Standard is used to creating a shared library that can be re-used in any .NET platform.

I hope you have liked this and now know about the differences between .NET Framework, .NET Core, and .NET Standard.