dotnet 可执行文件是用什么语言编写的?

发布于 2024-10-31 14:32:28 字数 80 浏览 4 评论 0原文

我以为它会是通用中间语言,但在记事本中它看起来根本不是那样的。它在现实中看起来比教程中更难看吗?或者是从 CIL 进一步编译而来的某种字节码形式?

I thought it would be Common Intermediate Language, but in notepad it does not look like that at all. Does it just look uglier in reality than in tutorials? Or is it some bytecode form that is further compiled from CIL?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

当梦初醒 2024-11-07 14:32:28

它的 CIL 是二进制格式的名称,而不是您正在考虑的“汇编程序”的名称。

您能想象 .NET 程序集是文本文件吗?

It's CIL is the name of the binary format, not of the "assembler" you're thinking of.

Can you possibly imagine that .NET assemblies would be text files?

瞄了个咪的 2024-11-07 14:32:28

.NET 可执行文件是具有 PE​​ 标头的二进制文件(与本机可执行文件相同,但值略有不同)。 PE 头告诉操作系统加载 CLR,CLR 又加载程序集。

标头之外的内容是 CIL 代码的二进制表示形式,以及一些元数据和其他内容。您在教程中看到的文本是 CIL 的文本表示形式,就像您在汇编语言编程教程中看到的汇编语言代码只是二进制机器代码的文本表示形式一样。

请参阅 http://www.yetanotherchris。 me/home/2010/7/12/inside-net-assemblies-part-1.html(以及其他许多信息)了解更多信息。

A .NET executable is a binary file that has a PE header (same as a native executable, but with slightly different values). The PE header tells the OS to load the CLR, which in turn loads the assembly.

The content beyond the header is a binary representation of the CIL code, plus some metadata and other stuff. The text you see in tutorials is the text representation of CIL, in much the same way that the assembly language code you see in a tutorial about assembly language programming is just the text representation of the binary machine code.

See http://www.yetanotherchris.me/home/2010/7/12/inside-net-assemblies-part-1.html (among many others) for more information.

染火枫林 2024-11-07 14:32:28

.Net 可执行文件通常不是编写的,而是由另一种语言(例如 C#、F# 或 VB.Net)编译而成。

.Net 可执行文件的内容可以使用 ILDASM 工具查看。

内容首先是用于反射、签名或其他元代码目的的清单。

其次是 MSIL 指令本身。它们采用字节码格式,但 ILDASM 会向您显示指令是什么。

有时,可执行文件中会包含图像、声音或其他内容等资源。

可执行文件在安装期间(我认为这并不常见)或作为执行的前身被及时编译为本机代码。生成的本机代码可以存储以供重用。 (这是我在 PDC 2001 期间被告知的,可能“过时了”。)

A .Net executable is usually not written, it is compiled from another language such as C#, F# or VB.Net.

The contents of a .Net executable can be viewed with the ILDASM tool.

The contents are first a manifest which is used for reflection, signatures or other meta-code purposes.

Secondly there are the MSIL instructions themselves. These are in a kind of bytecode format, but ILDASM will show you what the instructions are.

And there are sometimes resources such as imagery, sounds or other content packed into the executable.

The executable is just-in-time compiled to native code either during installation (I think this is uncommon), or as a precursor to execution. The resulting native code can be stored for reuse. (This is what I was told during PDC 2001, might be "out of date".)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文