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.
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.
That is .NET Native which I already mentioned. And it is only for Windows Store apps.