Understanding the relationship between .net and .net core and .net framework and .net standard

Recently, I am doing cross-platform things for C# programs, so I have carefully studied these things that are often confused.

.net is a platform for development. The official statement is:

free. cross-platform. open source. One developer platform to build all your apps.

.net core is a free, open-source hosted computer software framework for Windows, Linux, and macOS. It is the first official version developed by Microsoft and has a cross-platform capability application development framework (Application Framework).

The .net framework is mainly a framework developed based on the windows platform.

.NET Standard is a set of formal .NET API specifications for multiple .NET implementations. The motivation behind the introduction of .NET Standard was to improve consistency in the .NET ecosystem. .NET 5 and later versions take a different approach to establishing conformance that does not require .NET Standard in most cases. But if you want to share code between .NET Framework and any other .NET implementation such as .NET Core, your library must target .NET Standard 2.0. No new standard versions will be released, but .NET 5, .NET 6, and all future versions will continue to support .NET Standard 2.1 and earlier.

In the end, my understanding is this, because the .net framework does not support cross-platform, but sometimes it is necessary to do some cross-platform programs, so engineers who use the framework cannot do it. Language must be changed. Therefore, Microsoft developed .net core, which provides cross-platform capabilities, but it cannot completely resolve the conflict between the two, and the difficulty and workload of transplantation are not small. Therefore, a set of standard libraries is provided, which is .net standard, and this set of API supports various platforms. In this way, for engineers who use the framework, the common services of the platform can be extracted and made into a .net standard standard library, so that different platform services can call a set of common codes. Reduce the workload of transplantation.

This is only related to the need to transplant the framework program to do so is more reasonable. If it is a newly developed cross-platform program, you can directly choose the framework .net 5.0 or above. If you need to develop a specific platform business, you can introduce a specific platform framework, such as .net 50 -windows.10 to do so.

The .net standard supported by the .net framework is up to 2.0, which is also the recommended version.

The highest version of .net standard supported by .net core is 2.1

The screenshots below are for reference:

.NET standard 2.0 detailed API resolution address: .NET API Browser | Microsoft Docs

Guess you like

Origin blog.csdn.net/yunxiaobaobei/article/details/123770755