Introducing. NET core (Introduction to. NET Core)

Source: Internet
Author: User
Tags compact

This rookie is basically a British blind, this blog is I use Youdao translation, fortunately content is simple, I hope not fraught. Good English comrades can go directly to the original text: https://docs.asp.net/en/latest/getting-started/ Installing-on-windows.html, if someone can re-translate the release to let everyone learn that's good, save me such people to look up the words one by one.

Please correct me!

by Steve Smith

Author Steve Smith

. NET Core is a small, optimized runtime, the can be targeted by ASP. 5 applications. In fact, the new ASP. Templates target. NET Core by default, in the addition to the. NET Framework. Learn what targeting. NET Core means for your ASP. 5 application.

. NET core is a small, optimized,. NET 5 runtime. In fact, the default target for the new ASP. NET 5 project template is. NET Core, except for the. NET Framework. The ASP. NET 5 app targets.

In this article (this article includes the following subsections):
  • What's. NET core (what is. NET Core)?
  • Motivation Behind. NET core (the motivation behind. NET Core)
  • Building applications with. NET core (using. NET core fabric application)
  • . NET core and NuGet (. NET core and NuGet)
  • Additional Reading (Additional Reading)
What's. NET core (what are. NET Core)

. NET Core 5 is a modular runtime and library implementation that includes a subset of the. NET Framework. Currently it is feature complete on Windows, and in-progress builds exist for both Linux and OS x. NET Core consists of a set of libraries, called "Corefx", and a small, optimized runtime, called "CoreCLR". . NET Core is Open-source, so can follow progress on the project and contribute to it on GitHub:

. NET Core 5 is a more modular runtime and library implementation that is a subset of the. NET Framework. Currently fully functional on Windows, the Linux and OS X constructs are not yet complete.. NET core consists of a series of libraries called "Corefx" and streamlined, optimized, called "CoreCLR" runtimes.. NET core is open source, So you can follow the project on GitHub and contribute code to it.

  • . NET core Libraries (COREFX). NET Core class library (COREFX)
  • . NET core Common Language runtime (CoreCLR). NET core Common language runtime (CoreCLR)

The CoreCLR Runtime (MICROSOFT.CORECLR) and COREFX libraries are distributed via NuGet. The Corefx libraries is factored as individual NuGet packages according to functionality, named "System. [Module] "on nuget.org.

CoreCLR and Corefx are released through NuGet. Corefx is broken down into several separate, named "System" functions. [Module name] "NuGet package.

One of the key benefits of. NET Core is its portability. You can package and deploy the CoreCLR with your application, eliminating your application ' s dependency in an installed VE Rsion of. NET (e.g. NET Framework on Windows). You can host multiple applications side-by-side using different versions of the CoreCLR, and upgrade them individually, RA Ther than being forced to upgrade all of them simultaneously.

One of the main benefits of. NET core is its portability. You can package and deploy CORECLR your app, eliminating your app's dependencies. NET one installation version. Instead of forcing them to be upgraded, you can host multiple apps, each with a different version of CORECLR, and upgrade them independently of each other.

Corefx have been built as a componentized set of libraries, each requiring the minimum set of the library dependencies (e.g. Sy Stem. Collections only depends on System.Runtime, not System.Xml). This approach enables minimal distributions of COREFX libraries (just the ones you need) within an application, alongside CoreCLR. Corefx includes collections, console access, diagnostics, IO, LINQ, JSON, XML, and regular expression support, just to Nam e a few libraries. Another benefit of COREFX is the it allows developers to target a single common set of libraries The is supported by Mu Ltiple platforms.

Corefx is built into a series of component libraries, each of which requires a minimized class library dependency (for example, System.Collections relies only on system.runtime, not on System.Xml). This approach makes it possible to minimize the distribution of Corefx class libraries so that only the required is used. Corefx includes collections, console access, diagnostics, io,linq,json,xml, and regular expression support, which are just some of the examples. Corefx Another benefit is that it allows developers to focus on supporting a common class library set of multiple platforms.

Motivation Behind. NET core (the motivation behind. NET Core)

    when. NET first shipped in 2002, it is a single framework, but it didn ' t take long before the. NET Compact Framework shipped, providing a smaller version of. NET Designed for mobile devices. Over the years, this exercise is repeated multiple times, so that today there is different flavors of. NET specific to D Ifferent platforms. Add to this further platform reach provided by Mono and Xamarin, which target Linux, Mac, and native IOS and Android D Evices. For each platform, a separate vertical stack consisting of runtime, framework, and app model are required to develop. NET A Pplications. One of the primary goals of. NET Core is-provide a single, modular, cross-platform version of the. NET of works the same Across all of these platforms. Since. NET Core is a fully open source project, the Mono community can benefit from COREFX libraries. . NET Core won't replace Mono, but it'll allow the Mono community to reference and share, rather than duplicate, Certa In commonlibraries, and to contribute directly to COREFX, if desired.

    When. NET is available in 2002, it is a complete single framework, and soon after the. NET Compact Framework, the Compact Framework provides a small version of. NET for mobile devices. Over the years, this has been a recurring cycle, so there are now multiple. NET for different platforms. Plus run on Linux,mac, and native iOS and Android devices provided by Mono and Xamarin. Each platform has its own runtime, framework and application model for development. NET App. One of the main goals of. NET core is to provide a single, modular, cross-platform platform for all platforms. NET version. Because. NET core is a fully open source project, the mono community will benefit from the Corefx class library.. NET core will not replace Mono, but it will allow the mono community to reference and share instead of rewriting the public class library, and if you want, you can contribute code directly to Corefx.

    In addition to being able to target a variety of different device platforms, there is also pressure from The server side to reduce the overall footprint, and more importantly, surface area, the. NET Framework. By factoring the COREFX libraries and allowing individual applications to pulling in only those parts of Corefx they require (A so-called "pay-for-play" model), server-based applications built with ASP. 5 can minimize their dependencies. This, in turn, reduces the frequency with which patches and updates to the framework would impact these applications, since Only changes made to the individual pieces of Corefx leveraged by the application would impact the application. A smaller deployment size for the application are a side benefit, and one that makes more of a difference if many Applicati ONS is deployed side-by-side on a given server.

In addition to this cross-platform, there is a reduction in server resource consumption, and more importantly, the volume, volume (not translated) of the. NET Framework. Service-based applications constructed with ASP. NET 5 can minimize their dependencies by refactoring the Corefx class library and allowing individual apps to reference only the part of the COREFX that is needed. Conversely, reducing the frequency of patching and updating the framework will compress these applications ... There is no translation here, please translate it yourself ...

Note (notice)

The overall size of. NET Core doesn ' t intend to being smaller than the. NET Framework over time, but since it is pay-for-play , most applications this utilize only parts of Corefx would have a smaller deployment footprint.

In the future, the full size of. NET core will not be smaller than the. NET Framework, but because it is pay-as-you-go, more applications that take advantage of only a portion of COREFX can make deployment less space.

Building applications with. NET core (building apps with. NET Core)

   . NET Core can used to build a variety of applications using different application models including WEB Applications, console applications and native mobile applications. The. NET execution Environment (DNX) provides a cross-platform runtime host the can use to build. NET Core based APPL Ications that can run on Windows, Mac and Linux and are the foundation for running ASP. Applications on. NET Core. Applications running on DNX can target the. NET Framework or. NET Core. In fact, DNX projects can being cross-compiled, targeting both of these frameworks in a single project, and the P roject templates ship with Visual Studio 2015. For example, The frameworks section of  Project.json  in a new ASP. 5 Web project would target  dnx451  and  dnxcore50  by Default:

By using different application templates,. NET core can be used to build a variety of applications, including Web applications, console apps, and native mobile apps. The. NET execution Environment (DNX) provides a cross-platform runtime host that you can use to construct. NET core-based applications. It can run on Windows,mac and Linux, and DNX is the foundation for running ASP. NET Apps. Apps running on DNX can target the. NET Framework or. NET Core. In fact, the DNX project can cross-compile on two frameworks in the same project, and this is supported by project templates in Visual Studio 2015. For example, by default, the frameworks section of the Project.json file in an ASP. NET 5 Web project is configured to target dnx451 and Dnxcor50.

"Frameworks"{        "dnx451""Dnxcore50"}},    

    dnx451Represents the. NET Framework, while dnxcore50 represents. NET Core 5 (5.0). You can use compiler directives ( #if ) to check for symbols, that correspond to the frameworks: DNX451 and DNXCORE50 . If for instance You has code that uses resources that is not available as part of the. NET Core, you can surround them in a Conditional compilation directive:

dnx451 says. NET Framework,dnxcore50 represents. NET Core 5 (5.0). You can use compiler directives (#if) to check for flags that match DNX451 and DNXCORE50. For example, your code uses a resource that is not part of the. NET core, and you can use conditional compilation directives outside of this piece of code:

#if DNX451        //utilize resource only available with. NET Framework#endif 

The recommendation from the ASP. Both frameworks with new applications. If you want to only target. NET Core, remove dnx451; The or to is the target. NET Framework, removednxcore50 from the frameworks listed in Project.json. Note that ASP. 4.6 and earlier target and require the. NET Framework, as they always has.

Asp. NET team, the recommended approach is to create a new application that targets two frameworks at the same time. If you want to target. NET Core only, remove the dnx451 from the Project.json file, or remove Dnxcore50 from the Project.json file for the. NET Framework only. Note that ASP. NET 4.6 and the earlier target framework and the requirements of the. NET framework are still as usual.

. NET core and NuGet (. NET core and NuGet)

Using NuGet allows for much + agile usage of the individual libraries that comprise. NET Core. It also means that's application can list a collection of NuGet packages (and associated version information) and this WI ll comprise both system/framework as well as third-party dependencies required. Further, Third-party dependencies can now also express their specific dependencies on framework features, making it much E Asier to ensure the proper packages and versions is pulled together during the development and build process.

Using NuGet, it is easy to use a separate class library that makes up. NET core. It also means that an app can list a series of nuget packages (and associated version information) and include systems/frameworks like third-party dependency requirements. Further, third-party dependencies can indicate that their designation relies on framework elements, making it very easy to ensure that specific packages and versions are included in the development and construction process.

If, for example, you need to use immutable collections, you can install the System.Collections.Immutable package via NuGet . The NuGet version would also align with the Assembly version, and would use semantic versioning.

If, for example, you need to use the immutable collection, you can install the System.Collections.Immutable package via NuGet. The NuGet version also matches the assembly version, and the version is used. (I can't translate it again)

Note (notice)

Although Corefx'll be made available as a fairly large number of individual NuGet packages, it'll continue to ship per Iodically as a full unit, Microsoft has tested as a whole. These distributions'll most likely ship at a lower cadence than individual packages allowing time to perform necessary Testing, fixes, and the distribution process.

Although Corefx will be used as a large number of separate nuget packages, it will continue to be released regularly as a full Microsoft-tested unit. These are likely to be released at a slower pace than the individual packages, with time to complete the necessary testing, patching, and publishing processes.

Summary (Summary)

. NET Core is a modular, streamlined subset of the. NET Framework and CLR. It is fully open-source and provides a common set of libraries the can be targeted across numerous platforms. Its factored approach allows applications to take dependencies only on those portions of the COREFX so they use, and the Smaller runtime is ideal for deployment to both small devices (though it doesn ' t yet support any) as well as Cloud-optimi Zed environments that need to being able to run many small applications side-by-side. Support for targeting. NET Core are built into the ASP. 5 project templates. Ship with Visual Studio 2015.

. NET Core is a more modular, streamlined subset of the. NET Framework and the CLR. It is fully open source and provides a common class library set that can be cross-platform. Its decomposition allows only those parts of the COREFX that they use only, and the smaller runtime is for deployment to small devices, as is the case with cloud environments, which require the ability to run many small applications at the same time. Visual Studio 2015 supports the construction of. NET core applications with the Project module ASP.

Additional Reading (Additional Reading)
Learn more on. NET Core: (more. NET Core)
  • Immo Landwerth explains. NET Core
  • What is. NET Core 5 and ASP. 5
  • . NET Core 5 on dotnetfoundation.org
  • . NET Core is Open Source
  • . NET Core on GitHub

Introducing. NET core (Introduction to. NET Core)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.