Content Main Source https://docs.asp.net/en/latest/conceptual-overview/dotnetcore.html
What is the . NET Core
. NET Core 5 includes a modular runtime and library implementation, which is a subset of the. NET Framework.
He includes a series of libraries, called "corefxcoreclr " Span lang= "ZH-CN". Both of them were released through nugetcorefxsystem.[ Module]. .net core Portabilitycoreclr.netwindows .net Framework . Because .net core.net Core
Corefx is a series of modular libraries, each of which has a minimum of dependencies (e.g. System.Collections only relies on system.runtime, not System.Xml ). This makes it possible to implement a minimal release of the Corefx library (along with CoreCLR) when the application is published . Corefx includes collections, console access, diagnostics, IO, LINQ, JSON, XML, and regular expression support, just to Nam e a few libraries. Another benefit is that Corefx enables developers to use a cross-platform public Library.
the motivation behind . NET Core
Earliest2002Years. NETAs a separateFrameworkReleased, and later gradually released different versions for different platforms, such as the. NET Compact Framework for mobile devices, etc. In addition, there are linuxmacnative iOS and Android system Mono and Xamarin. For each platform, there is a separate .netframework,app Model.net core.net .net coremono communities can corefx.net coremono, but he allows mono Community reference and share some common libraries, not replication.
Another pressure is from the server side, by building Corefx, allowing the app to contain only the portion of the COREFX that they need (that is, pay for play model), Therefore, you can minimize dependencies . The benefit is that reducing the number of patches and upgrades, and their impact, also reduces the size of the application.
build Apps with. NET Core
. NET CoreCan BuildWeb app,console AppAndNative mobile app. NET execution Environment (DNX)Provides a block platform for theRuntime Host,Be able to use it to build on. NET Corewindows,linux ,macdnx.net coreasp.net the basis of application. In fact dnxvs2015asp.net "en-US" 5project.jsonframeworks part, which includes dnx451dnxcore50
"Frameworks": {
"dnx451": {}, This is the representative . NETFramework
"Dnxcore50": {} this is representative . Netcore 5(5. 0)
},
In the project, you can use the compile command #if to determine the version, as follows
#if DNX451
Utilize resource only available with. NET Framework
#endif
Depending on the project requirements, you can use only dnx51 or dnxcore50, but the versions prior to ASP. NET 4.6 ( included ) are required . NETFramework.
. NET Core and NuGet
Using NuGet makes it easier to use the various libraries of. NET Core , which means that the app can list only one NuGet package (and the corresponding version information) that contains only its own needs. This list can contain system/framework and can also contain third-party dependencies. and third-party dependencies can Express their reliance on the Framework features, enabling them to get the right version of the package during development and compilation. For example, if you need a immutable collection, you can install the System.Collections.Immutable package through NuGet . The NuGet version will also match the assembly version and will use semantic versioning .
Note: Although Corefx can get a lot of individual packages through NuGet, he or she is periodically released and tested as a whole. The release of such releases relative to individual packages is likely to be relatively low frequency, allowing time for the necessary test,fix, and distribution processto be performed.
Summarize
. NET Core is amodular, streamlined subset of the. NET Framework and CLR. It is Fullyopen-source and provides a common set of libraries the can be targeted acrossnumerous platforms. Its factored approach allows applications to takedependencies is on those portions of the COREFX so they use, and thes Maller Runtime is ideal for deployment to both small devices (though ITDOESN ' t yet support any) as well as cloud-optimized Environments that need tobe able to run many small applications side-by-side. Support for targeting. Netcore is built into the ASP. 5 project templates. Ship with Visual Studio2015.
Introduction to. NET Core