Export (0) Print
Expand All

Compiling Apps with .NET Native

.NET Framework 4.5

Note Note

This topic refers to the .NET Native Developer Preview, which is pre-release software. You can download the preview from the Microsoft Connect website (requires registration).

.NET Native is a precompilation technology for building and deploying Windows Store apps. It compiles apps that are written in managed code (C#) and that target the .NET Framework to native code.

Typically, apps that target the .NET Framework are compiled to intermediate language (IL). At run time, the just-in-time (JIT) compiler translates the IL to native code. In contrast, .NET Native compiles Windows Store apps directly to native code. For developers, this means:

  • Your apps will provide the superior performance of native code.

  • You can continue to program in C#.

  • You can continue to take advantage of the resources provided by the .NET Framework, including its class library, automatic memory management and garbage collection, and exception handling.

For users of your apps, .NET Native offers these advantages:

  • Fast execution times

  • Consistently speedy startup times

  • Low deployment and update costs

  • Optimized app memory usage

But .NET Native involves more than a compilation to native code. It transforms the way that .NET Framework apps are built and executed. In particular:

  • During precompilation, required portions of the .NET Framework are statically linked into your app. This allows the app to run with app-local libraries of the .NET Framework, and the compiler to perform global analysis to deliver performance wins. As a result, apps launch consistently faster even after .NET Framework updates.

  • The .NET Native runtime is optimized for static precompilation and thus is able to offer superior performance. At the same time, it retains the core reflection features that developers find so productive.

  • .NET Native uses the same back end as the C++ compiler, which is optimized for static precompilation scenarios.

.NET Native is able to bring the performance benefits of C++ to managed code developers because it uses the same or similar tools as C++ under the hood, as shown in this table.

.NET Native



The .NET Framework + Windows Runtime

Win32 + Windows Runtime


UTC optimizing compiler

UTC optimizing compiler


Ready-to-run binaries

Ready-to-run binaries (ASM)


MRT.dll (Minimal CLR Runtime)

CRT.dll (C Runtime)

For Windows Store apps for Windows 8.1, you upload .NET Native Code Compilation binaries in app packages (.appx files) to the Windows Store.

© 2014 Microsoft