简体   繁体   English

.NET Core如何在内部工作而不是.NET Framework?

[英]How does .NET Core Work Internally versus .NET Framework?

How does .NET Core differ in terms of internal implementation from .NET Framework in regards to how programs are built and ran? .NET Core 在内部实现方面与程序的构建和运行方式有何不同? I am aware that regular .NET Framework/C# projects essentially get compiled down to CIL code, distributed, and then compiled at runtime by the JITer, turning them finally into machine code on function-by-function basis (unless the programmer has specified the pre-compiled option). 我知道常规的.NET Framework / C#项目基本上被编译成CIL代码,分发,然后由JITer在运行时编译,最终将它们逐个函数地转换为机器代码(除非程序员指定了预编译选项)。 Is this all true for .NET Core applications as well? 这对于.NET Core应用程序也是如此吗? Are there any major differences ? 有什么重大差异吗?

Things to note: 注意事项:

  1. Yes, I am aware that both of these things are very complicated and I am not expecting the answerer to go into full details explaining every little component. 是的,我知道这些事情都非常复杂,我不希望回答者详细解释每个小组件。

  2. I've heard of .NET Framework's CLR being called a virtual machine before but I know that is up to debate and have seen such debate in posts such as this one , as is the comparison of CIL to Java's bytecode. 我听说过.NET框架的CLR被称为虚拟机之前,但我知道那是达到辩论,并已经看到了帖子,如这种辩论这一个 ,因为是CIL的Java的字节码进行比较。 These are frivolous arguments and not relevant to the question. 这些都是无聊的论点,与问题无关。

  3. I've found similar questions out there, however, the questions seem to be focused on how .NET Core differs in terms of functionality/usability to us as client programmers. 我发现了类似的问题,然而,问题似乎集中在.NET Core在功能/可用性方面与我们作为客户端程序员的区别。 This question has nothing to do with that, but is asking how .NET Core is different from .NET Framework in terms of internal implementation. 这个问题与此无关,而是在内部实现方面询问.NET Core与.NET Framework的区别。

Thank you. 谢谢。

There isn't a difference in the IL or JIT process. IL或JIT流程没有区别。 I have old .NET code that directly executes IL that works fine on Core. 我有旧的.NET代码直接执行IL,在Core上工作正常。 They both fully implement the CLI ECMA standard , they both have the same runtime component. 它们都完全实现了CLI ECMA标准 ,它们都具有相同的运行时组件。

There may be very fine grain differences on the implementation per platform, as there was between Windows .NET and Mono , but I'm not aware of any. 每个平台的实现可能存在非常细微的差异,因为Windows .NET和Mono之间存在差异,但我不知道。

The CLI step and the framework are actually different things: you could probably build C# code that compiled to valid IL without either .NET or Core, but I'm not sure what you could actually do without even primitive types. CLI步骤和框架实际上是不同的东西:您可能构建C#代码,无需.NET或Core即可编译为有效的IL,但我不确定如果没有原始类型,您实际上可以做什么。

The difference is almost entirely in the supported framework - while full fat .NET is tied to Windows, the .NET Standard libraries are truly cross platform. 差异几乎完全在支持的框架中 - 虽然全胖.NET与Windows绑定,但.NET标准库是真正的跨平台。

There this question is far too big: there has been a concerted effort to port over everything in .NET over to .NET Standard 1.5, but there's a lot of it. 这个问题太大了:已经齐心协力将.NET中的所有内容移植到.NET Standard 1.5上,但是有很多内容。 For .NET Core there are a couple of places there's a whole new paradigm (for instance ASP.MVC and ASP Core MVC are completely different). 对于.NET Core,有几个地方有一个全新的范例(例如ASP.MVC和ASP Core MVC完全不同)。 You may be better narrowing the question down to a specific area and platform. 您可能会更好地将问题缩小到特定区域和平台。

Fairly soon all .NET will run on the .Net Standard 2.0 libraries, and .NET Framework 4/5/whatever will just be the legacy and Windows-only components (WPF, WinForms, etc) running on top. 很快, 所有的 .NET都将在.Net Standard 2.0库和.NET Framework 4/5上运行,而这些只是在顶层运行的遗留和仅Windows组件(WPF,WinForms等)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM