Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I enable .Net Native on my Application?

With the recent announcement of .Net compiling to native code, I want to know how can I enable this functionality in my applications? Does it work for all project types and all platforms?

like image 747
John Koerner Avatar asked Apr 04 '14 03:04

John Koerner


People also ask

How does every managed Windows app use native code?

Every managed (C# or VB) Universal Windows app will utilize this new technology. The applications are automatically compiled to native code before they reach consumer devices. If you’d like to dive deeper in how it works, I highly recommend reading more on it at MSDN. How does .NET Native impact me and my app?

How do I create a native app for Windows 10?

To create a .NET Native app, follow these steps: Develop a Universal Windows Platform (UWP) app, and test the debug builds of your app to ensure that it works properly. Handle additional reflection and serialization usage. Manually resolve missing metadata, and repeat step 3 until all issues are resolved.

How do I enable NET Framework in Windows 10?

From the Control Panel, click Programs and Features. When the Programs and Features window comes up, click Turn Windows Features On or Off. Then check .NET Framework 3.5 (includes .NET 2.0 and 3.0) and click OK.

What is NET Native in Visual Studio 2015?

.NET Native is a precompilation technology for building and deploying UWP apps.. NET Native is included with Visual Studio 2015 and later versions. It automatically compiles the release version of UWP apps that are written in managed code (C# or Visual Basic) to native code.


1 Answers

As of today, .Net Native only supports Windows Store Apps targeting ARM or X64. In the future other project types and platforms may be supported.

Start by making sure you have the correct tool chain installed. You need Visual Studio 2013 with Update 2 RC and the Native Developer preview installed on your machine:

  • VS 2013 Update 2 RC
  • .Net Native Developer Preview

After everything is installed, right click on your project and select Enable for .Net Native

enter image description here

After doing this, you should see a new file added to your project default.rd.xml. This is a report that tells you if your application is compatible with .net native code generation.

If everything is compatible, you can enable the compilation in the project properties. As I mentioned previously, this only works for x64 and ARM platforms at this time, so select one of those platforms and you can check the Compile with .Net Native tool chain option:

enter image description here

I suggest watching this channel 9 video on how the tooling works: http://channel9.msdn.com/Shows/Going+Deep/Inside-NET-Native

like image 123
John Koerner Avatar answered Sep 21 '22 20:09

John Koerner