Handmade Network»Forums
Shazan Shums
159 posts
Some day I will make quality software. Programming FTW.
Is there a way to compile .net code to native
I know that when you build a .net app it converts into IL code .Is it possible to compile IL or .net code into native assembly code.
Mārtiņš Možeiko
2562 posts / 2 projects
Is there a way to compile .net code to native
Typically for regular apps this is done with ngen at installation time. It takes your .net assembly and does AOT (ahead of time) compilation to native code. It applies CPU specific optimizations, so generated native code is not really distributable. Here's more information on ngen: https://msdn.microsoft.com/en-us/library/6t9t5wcf.aspx

If you use .NET Core runtime then it should be possible to use crossgen tool to compile native code. Not sure how well it is supported though. I believe officially they support AOT compilation only with CoreRT which is alternative .NET Core runtime. Here's the guide how to use it: https://github.com/dotnet/corert/blob/master/Documentation/README.md

And if you write Windows Store applications then you can use .NET Native (which comes with Visual Studio) to do AOT.
Jack Mott
110 posts
Web Developer by day, game hobbyist by night.
Is there a way to compile .net code to native
Here is some info:
https://msdn.microsoft.com/en-us/library/dn584397(v=vs.110).aspx
Mārtiņš Možeiko
2562 posts / 2 projects
Is there a way to compile .net code to native
That is .NET Native which I already mentioned. And it is only for Windows Store apps.