Bundle .NET dlls to run application in .NET-less machine?

南楼画角 提交于 2019-11-30 19:48:04

Have a look at Microsoft .NET Native:

.NET Native compiles C# to native machine code that performs like C++. You will continue to benefit from the productivity and familiarity of the .NET Framework with the great performance of native code.

It will be integrated in Visual Studio 2014.

You cannot do this. Many essential components such as the garbage collector are part of the CLR (which is part of the framework runtime), so in order to successfully execute your application you need the framework installed.

That's not how Ngen works. It only bypasses the JIT compilation step. The resulting .ni.dll file only contains machine code, not the metadata of the assembly. You need to keep the original assembly available for that. And the CLR and the .NET framework assemblies must be available on the target machine, requiring you to install .NET.

Axarydax

See How to compile a .NET application to native code? - the consensus looks to be that it's not possible.

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