Are there tools to compile CIL to a binary?

冷暖自知 提交于 2019-12-06 08:49:14

问题


After seeing a previous post "Making Applications programmed in .NET languages work on older machines", I've got to wonder;

Are there tools to compile CIL to a binary?

If so, you could convert a CIL file to a native Windows app if you didn't want the user to require the .NET framework? Or even target the linux platform from .NET! That would be awesome!


回答1:


Check this out: http://msdn.microsoft.com/en-us/library/6t9t5wcf.aspx

And this: http://www.xenocode.com/Products/Postbuild-for-NET/?AdGroup=Linking&gclid=CNGCo-7zopcCFSYMDQod0giG_A




回答2:


MS provides a free utility called NGEN that creates a native Windows executable from your .NET assembly.

But be aware that the CLR still requires your assembly to be available for fallback in case of native image invalidation, which can happen for a number of reasons. And also NGEN doesn't remove the necessity for your end-user to have the .NET Framework installed. Finally, NGEN can change the performance profile of your app, not always for the better.

There are utilities such as VMWare ThinApp (formerly Thinstall) that will create a native binary that includes your app and the relevant parts of the .NET Framework. This may be what you're looking for.




回答3:


Lego.NET can create native binaries, but it's still fairly limited.




回答4:


There are tools to do it, but they basically package the entire .NET framework with your binary, which as you can imagine, causes considerable bloat.

Requiring people to have .NET installed isn't much of an ask these days. MS even provides an MSI package you can include into your own installer so that it's an option when they install your program.



来源:https://stackoverflow.com/questions/335499/are-there-tools-to-compile-cil-to-a-binary

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!