.Net Framework Vs .Net Core Vs .Net Standard

Introduction

In this article, I am going to explain the .Net framework, .Net Standard, and .Net core.

The first question that comes to mind is, how many .Net software frameworks are available in the market?

The answer is

Currently, Microsoft has three frameworks available in the market,

  • .Net Framework
  • .Net standard
  • .Net core

So a few questions come to mind

  1. When to use which framework?
  2. Difference between these frameworks?

That’s what this article is about. I will try to explain these frameworks in this article.

.Net Framework

Microsoft introduced the .Net framework in 2000 to build Web and Windows applications (desktop applications) using different languages like C#, Visual Studio, F#, etc.

This framework has been widely used in the IT industry for more than 20 years. It is a very popular Microsoft framework. This is the first managed framework released by Microsoft.

The latest available version of .Net Framework is 4.8.

Below are some important concepts of the .Net framework,

  • Intermediate Language (IL): .Net code is compiled into a special language called Intermediate Language. It is stored in .dll or .exe files.
  • Common language runtime (CLR): Common language runtime handles the execution of the application.
  • Just In Time (JIT): CLR used assembly and turn into machine code through the process. This process is known as Just In Time (JIT) compilation.
  • Base Class Library (BCL): Microsoft provided a reusable library that can be used in your application while developing code.

Expect these concepts; the .Net framework has CTS (Common Type System), Garbage collection, Memory management, etc.

Below are a few important points about .Net Framework,

  1. In the case of the ASP.Net Web Forms application, we should use the .Net Framework. .Net Core has no plans to introduce ASP.Net Web Forms in the future.
  2. ASP.Net pages are not included in .Net Core.
  3. WCF Server implementation is only available on .Net Framework.
  4. Window Workflows is only available in .Net Core.
  5. ADO.Net Data Services is only available in .Net Core.
  6. Some third-party and Microsoft platforms don’t support .Net Core.
  7. Some Azure services or SDKs are not available for .Net Core.

In simple words, we can say, the .Net Framework can be used for web and window application development which works with the Windows operating system.

.Net Core

Software development and app development trends have changed in the last few years. Now the IT Industry needs platforms that can be used with different operating systems.

As the .Net framework was working with only Windows, Microsoft introduced the .Net core for cross-platform as per market demand.

  1. Below are a few important points about .Net Core,
  2. .Net core is a free, open-source, and cross-platform implementation of .Net.
  3. It can be used for Windows, Linux, and Mac operating systems.
  4. .Net core supports C#, Visual Basic, and F# languages for development.
  5. Flexible deployment: (User-wide or System-wide)
  6. Includes common line tool and also works with deployment tools like Docker.
  7. It supports Console, Asp.net Core, Cloud, and Universal window platforms. Windows Form and Window Presentation Form (WPF) are not part of the .Net core.
  8. Used for creating High-Performance and Scalable systems.
  9. .Net Core can be used whenever Microservices are required.

The below diagram shows .Net Core release lifecycles

Version

.Net Standard

Before starting with the .Net Standard, let’s discuss the .Net framework and .Net core architecture using the below diagram.

App mobile

We have already discussed BCL (Base Class Library) in the .Net Framework section. As per the above image, you can see all three frameworks have their base class libraries.

  1. .Net Framework has .Net Framework BCL
  2. .Net Core has .Net Core BCL
  3. Mono has Mono BCL

Let’s assume that I have shared a library developed in .Net Framework. I want to use this Library in multiple projects some of the projects have been created in .Net core. That’s where the problem starts. Can you guess what’s the problem???

.Net Framework and .Net core have different BCLs, hence .Net Framework library is not compatible with the .Net core and vice versa. To solve this problem Microsoft introduced the .Net standard.

App model

As per the above image, the .Net standard replaces all different BCLs for all frameworks. In other words, we can say, that all frameworks have common BCLs called .Net standards.

.Net standard is a set of APIs that all .Net framework implements.

.Net standard can replace all versions of .Net Framework/.Net core etc. Microsoft explains that using the below diagram,

Dot Net Standard

We can conclude based on the above matrix

Lower .Net standard in the means it will target to more applications. If your .Net standard is 1.0 it will run in all applications.

If the .Net standard has a higher version then more APIs/inbuilt libraries like “System. data” are available.

So based on project requirements .Net standard library needs to be created.

The latest version of the .Net standard framework is 2.1.

Following are a few available Microsoft Visual Studio templates:

Console app

As per the above image, you can see that the .Net standard framework has only a Class library. Once we have decided on platforms and project types, based on the requirements we can use the accurate version.

Hope you enjoyed this article and found it useful. Thank you for reading this article.