Search code examples
c#ngen.net-native

What is the difference between .NET Native and Ngen.exe?


The title says it all. I was hoping somebody could explain to me what .NET Native brings to the table that we didn't already have with Ngen.exe.


Solution

  • As far as I know Ngen still depends on the framework, which .NET Native don't when it hit production according to the faq.

    Is this just about performance, or does this also allow for building C# code (say) that is natively compiled to Win32/64 and doesn’t require an install of the .NET Framework on the target machine?

    That is correct: .NET Native is not just about performance, but also about productivity and a consistent device experience. .NET Native allows you to write code using managed languages and upload MSIL packages as always. However, apps will get deployed on end-user devices as fully self-contained natively compiled code (when .NET Native enters production), and will not have a dependency on the .NET Framework on the target device/machine. As you know, .NET applications span a broad spectrum. Thus, we are investing big in the full .NET Framework as well (for example, we just released a CTP of RyuJIT).

    Microsoft .NET Native FAQ