.NET 编译的可执行文件包含什么?
我对 CIL、CLI、CLR 有点迷茫......我很想知道当我编译和运行我的应用程序时如何处理工作。
首先,应用程序被转换为 CIL。这是可执行文件中包含的字节码吗?我将非常感谢运行 .NET 应用程序的简单逐步描述。
Possible Duplicate:
What exactly happens when you run a .NET executable (step by step to the point where the program is loaded and running)?
I am kinda lost in terms of CIL, CLI, CLR...I would love to know how to process works when I compile and run my application.
At first the app is converted to CIL..is this the bytecode contained in the executable file? I would be so grateful for simple step-by-step description of running a .NET application.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
可以在此处找到摘要。
基本上,当您编译应用程序时,它会被编译为 CIL(字节码,以前称为 MSIL)。这是 .Net dll 中包含的内容,您可以使用 ILDASM 或 Reflector 等工具查看此字节码。
在运行时,即时编译器 (JIT) 将其编译为机器本机的实际可执行代码。事实上,使用名为 NGen 的工具,您可以“预编译”本机映像,以便您的 dll 实际上包含本机代码,但这是一个手动步骤,在大多数情况下都不会完成。
A summary can be found here.
Basically, when you compile your application, it is compiled into CIL (bytecode, previously known as MSIL). This is what is contained in your .Net dll, and you can see this bytecode using a tool like ILDASM or Reflector.
At runtime, the Just-In-Time compiler (JIT) compiles this into actual executable code which is native to your machine. In fact, using a tool called NGen, you can "pre-compile" native images so that your dlls actually contain native code, but this is a manual step and not done in most scenarios.