什么是“.NET Core”?

What is “.NET Core”?

最近在官方博客宣布,它是.NET Framework .NET的核心是要开放源代码。具有讽刺意味的是,作者mentions .NET Core解释什么是想在下一个邮件。更多细节后,另一个是在欧洲。

从提供的图:

.NET Core diagram

和文章文本本身,我会认为(在。NET的核心是显而易见的东西开放源类)是一个模块化全重新执行。IU是必要的框架组件加载和加载的包,多样nuget是现在。5,现在是一个ASP.NET模块,已经实现。我的理解是正确的。NET的核心?也许我失踪的东西呢?

我发现了两个最近的文章是短的和非常好的。它涵盖的核心标准和.NET,.NET,.NET框架和他们的关系。高度推荐它。


从2015年announcing .NET .NET博客预览:a:for .NET的新时代

.NET Core has two major components. It includes a small runtime that is built from the same codebase as the .NET Framework CLR. The .NET Core runtime includes the same GC and JIT (RyuJIT), but doesn’t include features like Application Domains or Code Access Security. The runtime is delivered via NuGet, as part of the [ASP.NET Core] package.

.NET Core also includes the base class libraries. These libraries are largely the same code as the .NET Framework class libraries, but have been factored (removal of dependencies) to enable us to ship a smaller set of libraries. These libraries are shipped as System.* NuGet packages on NuGet.org.

和:

[ASP.NET Core] is the first workload that has adopted .NET Core. [ASP.NET Core] runs on both the .NET Framework and .NET Core. A key value of [ASP.NET Core] is that it can run on multiple versions of [.NET Core] on the same machine. Website A and website B can run on two different versions of .NET Core on the same machine, or they can use the same version.

短的:第一,在微软的.NET框架,其中包括一个应用程序代码和运行时库executes几乎完全记录,和一个标准的类库。

在运行时,公共语言运行库和公共语言基础设施是实现作品与JIT编译器,运行在CIL(原MSIL字节码)。

微软的.NET是规范和执行,在其历史和用途,在Windows和IIS为中心和"胖"。有一个图书馆的变化少,命名空间和类型,但它是个有用的Web或桌面开发或是troublesome港口从法律角度。

因此,为了提供一个非微软的.NET版本,可以运行在非Windows的机器,有一个发达的替代。在运行时,不仅移植了安切洛蒂的那个,但我对整个框架类库。会议通过的决议》。上大学是一个完全独立的,从微软的编译器,一个最常用的语言是必需的。

单是一个唯一的选择,如果需要执行的运行时,它运行在Windows的各种决定其此外,几乎所有的命名空间在。NET Framework类库为4.5和# VB和C编译器。

Enter:在.NET核心的开放源码实现的运行时库,和一个最小的类库。所有的附加功能是通过nuget包交付,部署特定的运行时库,框架和第三方软件包和应用程序本身。

核心是一个新版本的ASP.NET MVC和webapi捆在一起,一个HTTP服务器抽象瘦,这是运行在.NET运行时的核心,但也在。NET框架。


它是一个子集的.NET Framework,入门版与紧凑框架。progressed到Silverlight,Windows和Windows Phone Store。专注于维持配置小,适合快速下载和存储设备的能力是有限的。和更容易的把非Windows平台上的理由,当然是选择作为源开放版。"难"和"昂贵"的CLR和基地的部分是omitted类库。

否则,当你的目标是很容易认识到这样一个框架版本,很多东西是缺失的。你会使用一套不同的参考组件,只暴露什么的运行时支持。存储在您的机器在C:\Program Files (x86)
eference Assemblies\Microsoft\Framework\.NETCore
目录。

更新:.netcore 2发布后,我见过一些代表分配给Insight是非常。他们已经在工作的后台硬支撑框架的API来.netcore在过去两年。.netcore 1.0的标准API支持的工作。.netcore 2.0增加到20000的API,使总数约32000和允许现有的nuget包70 %的移植。有一套API是太严重的wedded Windows到Linux和MacOS易于端口。覆盖由最近发布的Windows兼容包,它添加另一个20000的API。


我发现最近的文章既短小又好。它包括.NET标准,.NET核心和.NET框架及其关系。强烈推荐。不幸的是,没有时间适应并把它放在这里。

原始答案内容如下:

因此,基于对这一主题的最新官方记录,我认为这里有一些要点:

0

因此.NET native和ASP.NET 5只是新框架配置的测试"主题",部分原因可能是它们有很大的不同:

enter image description here

看,它们甚至需要单独的低水平,但是BCL的主要部分仍然很常见:

We think of .NET Core as not being specific to either .NET Native nor
ASP.NET 5 – the BCL and the runtimes are general purpose and designed
to be modular. As such, it forms the foundation for all future .NET
verticals.

也就是说,顶部的洋红色矩形将大量添加到新的应用程序模型中,但基础将保持通用。

Nuget部署:

In contrast to the .NET Framework, the .NET Core platform will be
delivered as a set of NuGet packages. We’ve settled on NuGet because
that’s where the majority of the library ecosystem already is.

与当前框架的关系:

For Visual Studio 2015 our goal is to make sure that .NET Core is a
pure subset of the .NET Framework. In other words, there wouldn’t be
any feature gaps. After Visual Studio 2015 is released our expectation
is that .NET Core will version faster than the .NET Framework. This
means that there will be points in time where a feature will only be
available on the .NET Core based platforms.

总结:

The .NET Core platform is a new .NET stack that is optimized for open
source development and agile delivery on NuGet. We’re working with the
Mono community to make it great on Windows, Linux and Mac, and
Microsoft will support it on all three platforms.

We’re retaining the values that the .NET Framework brings to
enterprise class development. We’ll offer .NET Core distributions that
represent a set of NuGet packages that we tested and support together.
Visual Studio remains your one- stop-shop for development. Consuming
NuGet packages that are part of a distribution doesn’t require an
internet connection.

基本上,这可以被认为是一个.NET 4.6,它的分布模型发生了变化,同时,它正在成为一个开源的过程中。


当前文档对.NET核心是什么、要使用的区域等有很好的解释。以下特性最能定义.NET核心:

Flexible deployment: Can be included in your app or installed
side-by-side user- or machine-wide.

Cross-platform: Runs on Windows,
macOS and Linux; can be ported to other OSes. The supported Operating
Systems (OS), CPUs and application scenarios will grow over time,
provided by Microsoft, other companies, and individuals.

Command-line tools: All product scenarios can be exercised at the command-line.

Compatible: .NET Core is compatible with .NET Framework, Xamarin and
Mono, via the .NET Standard Library.

Open source: The .NET Core
platform is open source, using MIT and Apache 2 licenses.
Documentation is licensed under CC-BY. .NET Core is a .NET Foundation
project.

Supported by Microsoft: .NET Core is supported by Microsoft,
per .NET Core Support

下面是.NET核心的内容:

A .NET runtime, which provides a type system, assembly loading, a garbage collector, native interop and other basic services.

A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities.

A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK.

The 'dotnet' app host, which is used to launch .NET Core apps. It selects the runtime and hosts the runtime, provides an assembly loading policy and launches the app. The same host is also used to launch SDK tools in much the same way.


.NET核心是一种新的跨平台实现.NET标准(ECMA 335),与Mono类似,但由微软自己完成。

参见docs.microsoft.com


微软认识到了未来的Web开源模式,并决定向其他操作系统开放.NET。.NET核心是用于Mac和Linux的.NET框架。它是一个"轻量级".NET框架,因此缺少一些功能/库。在Windows上,我仍然会运行.NET Framework/VS2015。.NET Core与Nodejs、NPM、Yeoman、Docker等开源世界更为友好。您可以使用Visual Studio code+.NET Core在Mac或Linux上开发成熟的网站和RESTful API,这在以前是不可能的。所以,如果你喜欢Mac或Ubuntu,并且你是.NET开发人员,那就去设置它吧。对于Mono与.NET核心,Mono是作为Linux的.NET框架开发的,现在由微软(称为Xamarin)收购,并用于移动开发。最终,微软可能会将Mono合并/迁移到.NET核心。我现在不担心单核细胞增多症。


今天正在尝试在VS2017中创建一个新项目(最近从2015年升级),并注意到项目类型的新选择集。要么是新的,要么是我刚开始一个新项目已经有一段时间了!!)

enter image description here

找到了这个文档链接,发现它非常有用,所以共享。文章中还提供了项目符号的详细信息。只是在这里张贴项目符号:

You should use .NET Core for your server application when:

1
2
3
4
5
You have cross-platform needs.
You are targeting microservices.
You are using Docker containers.
You need high performance and scalable systems.
You need side by side of .NET versions by application.

You should use .NET Framework for your server application when:

1
2
3
4
Your application currently uses .NET Framework (recommendation is to extend instead of migrating)
You need to use third-party .NET libraries or NuGet packages not available for .NET Core.
You need to use .NET technologies that are not available for .NET Core.
You need to use a platform that doesn’t support .NET Core.

从Microsoft网站:

.NET Core refers to several technologies including .NET Core, ASP.NET Core and Entity Framework Core.

这些技术不同于本机.NET,因为它们使用corecrl运行时(在通用Windows平台中使用)运行。

正如您在问题中提到的,.NET核心不仅是开源的,而且也是可移植的[在MacOS、Windows和Linux上运行]

.NET内核的内部也经过优化,除非应用程序需要,否则不会使用其核心库中的不同模块。


微软刚刚发布了.NET核心v 3.0,这是一个改进了很多的.NET核心版本。

有关更多详细信息,请访问这篇伟大的文章:https://www.c-sharpcorner.com/article/difference-between-net-framework-and-net-core/从一个月前开始


.NET核心是.NET Framework的开放源代码和跨平台版本。Microsoft产品除了对普通用户(尤其是.NET技术公司生产的产品的最终用户)来说,其强大的功能外,总是很昂贵。大多数低层用户喜欢使用Linux作为操作系统,而在.NET内核之前,尽管他们有很强的能力,但他们还是不想使用Microsoft技术。但是在.NET内核生产之后,这个问题完全解决了,我们可以在不考虑他们的操作系统等的情况下满足我们的客户。