如何编译.NET应用程序到本机code? [英] How to compile a .NET application to native code?
问题描述
如果我想运行在一台机器,在.NET框架是不可用.NET应用程序;有没有什么办法来编译应用程序到本地code?
If I want to run a .NET application in a machine where the .NET framework is not available; Is there any way to compile the application to native code?
推荐答案
微软有一篇文章描述了如何可以的编译MSIL到本机code
Microsoft has an article describing how you can Compile MSIL to Native Code
您可以使用 NGEN 。
本机映像生成器(Ngen.exe) 是,提高了一个工具 管理应用程序的性能。 Ngen.exe创建本机映像,这 是包含编译后的文件 处理器专用的机床code和 把其安装到本机映像 高速缓存在本地计算机上。该 运行时可以使用从本机映像 高速缓存,而不是使用刚刚在时间 (JIT)编译器来编译所述原始 装配。
The Native Image Generator (Ngen.exe) is a tool that improves the performance of managed applications. Ngen.exe creates native images, which are files containing compiled processor-specific machine code, and installs them into the native image cache on the local computer. The runtime can use native images from the cache instead using the just-in-time (JIT) compiler to compile the original assembly.
不幸的是,你仍然需要为了运行您的程序从架构库。有没有功能,我所知道的与MS框架SDK,使您可以编译所有必需的文件到一个可执行
Unfortunately, you still need the libraries from the framework in order to run your program. There's no feature that I know of with the MS .Net framework SDK that allows you to compile all the required files into a single executable
这篇关于如何编译.NET应用程序到本机code?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!