gpt4 book ai didi

.net - ngen 是否用于将 .NET 代码编译成在运行代码时不需要安装 .NET 框架的二进制文件?

转载 作者:行者123 更新时间:2023-12-01 00:11:24 28 4
gpt4 key购买 nike

我在 Wikipedia 上阅读了以下关于 CLR 的文章:

Alternatively, the CIL code can be compiled to native code in a separate step prior to runtime by using the Native Image Generator (NGEN). This speeds up all later runs of the software as the CIL-to-native compilation is no longer necessary.

这是否意味着我可以获取任何 .NET 程序并将其编译为二进制文件,然后该二进制文件将能够在未安装 .NET 框架的机器上运行?

最佳答案

没有。

这意味着您在运行代码时不需要运行 JIT (Just-In-Time) 编译器,因为 NGen 已经将其转换为机器码。生成的二进制文件仍然依赖于 .Net 框架,并且必须在机器上单独安装。

有些工具可以打包 .Net 框架程序集并将它们以不需要 .Net 框架的方式包含在您的二进制文件中。查看 http://www.xenocode.com/ . VMWare 买了一个叫 Thinstall 的工具,我认为它也可以做到这一点:http://www.vmware.com/products/thinapp/ .

关于.net - ngen 是否用于将 .NET 代码编译成在运行代码时不需要安装 .NET 框架的二进制文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3173116/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com