Recently, Microsoft released. NET Core 2.0, but there is still some confusion among developers about the difference between. NET core,. NET Standard, Xamarin, and the. NET Framework.
The. NET framework is used to build desktop applications and to run ASP. Web applications on the Internet Information Server (IIS). It is the first managed framework.
Xamarin is a framework for building iOS, Android, MacOS, and desktop applications.
. NET Core
. NET core is a free, cross-platform, open-source implementation of the managed framework. It supports 4 types of applications: console, ASP. NET Core, Cloud, and universal Windows Platform (UWP). Windows Forms and Windows Presentation Foundation (WPF) are not included in. NET Core.
Technically speaking,. NET Core supports only console applications. The ASP. NET core and UWP are application models built on the basis of.
Unlike the. NET Framework,. NET core is not considered as a Windows component. Therefore, the update is in the form of a nutget package, not through Windows Update. Because the. NET core runtime is installed as App-local, and the application upgrade is done through the Package manager, the application can associate a specific. NET core version with a separate upgrade.
. NET Standard
Each of the implementations of the managed framework has its own base class library. The Base Class library (BCL) contains classes such as exception handling, strings, XML, I/O, networks, and collections.
. NET Standard is a specification for implementing the BCL. Because. NET implementations need to follow this specification, so application developers don't have to worry about the different BCL implementations of each managed framework.
Framework class Libraries (FCL), such as WPF, WCF, and ASP. NET, are not included in the BCL and, therefore, are not included in.
The relationship between. NET Standard and. NET implementations is the same as the relationship between the HTML specification and the browser. The latter is the realization of the former.
Therefore, the. NET Framework, Xamarin, and. NET Core, each managed framework implements the BCL in. NET Standard. As the computer industry continues to introduce new hardware and operating systems, new will emerge in the future. NET Managed framework. This standard lets application developers know that they can rely on a consistent set of APIs.
Each. NET version corresponds to a. NET Standard version.
APIs are consistent, porting applications to different managed implementations and providing tools is easier.
. NET standard is defined as a single NuGet package because of all of the. NET implementation must support it. Tools have become simpler because they have the same API for specific versions. You can also target multiple. NET implementation to build a library project.
You can also build a. NET standard wrapper for a specific platform API.
. NET Standard VS Portable Class Library
is the Portable class library doing the same thing?
Portable classes use common APIs that are supported by multiple platforms. As a result, the more platforms are supported, the fewer APIs are available, and it is difficult to know exactly which APIs are supported for a particular platform combination. For a new platform, the existing PCL must be recompiled. The PCL also requires Microsoft to create a new framework implementation branch for each platform.
Because. NET standard determines the API, not an implementation, there is no need to recompile the application. Any newly released. NET implementations all implement the necessary libraries. The application does not need to be recompiled to run on a new hardware platform or operating system. In theory, NotSupportedException exceptions may be caught while calling the API, but that should be rare.
Summary
. NET Standard is an API specification that defines the base class libraries that must be implemented for each specific version.
. NET core is a managed framework that is optimized for building consoles, cloud, ASP, and UWP applications. Each managed implementation, such as Xamarin,. NET core, or. NET Framework, must follow the. NET standard implementation of the BCL.
Original link: http://www.infoq.com/cn/news/2017/10/dotnet-core-standard-difference
View the English original:. NET Core and. NET Standard:what is the difference?
. NET Core,. NET Standard, Xamarin, and. NET Framework Comparison