{"id":18468,"date":"2014-04-02T16:30:00","date_gmt":"2014-04-02T16:30:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/dotnet\/2014\/04\/02\/announcing-net-native-preview\/"},"modified":"2021-09-30T17:00:58","modified_gmt":"2021-10-01T00:00:58","slug":"announcing-net-native-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-native-preview\/","title":{"rendered":"Announcing .NET Native Preview"},"content":{"rendered":"<p><em>This post was written by Subramanian Ramaswamy and Andrew Pardoe, Senior Program Managers on the .NET Native team.<\/em><\/p>\n<p>We\u2019re thrilled to announce the first release of .NET Native. Windows Store apps start up to 60% faster with .NET Native and have a much smaller memory footprint. Our first release is a Developer Preview that allows you to develop and test apps with this new compiler. This preview release of .NET Native offers you the performance of C++ with the productivity of C#.\u00a0 .NET Native enables the best of both worlds!<\/p>\n<p><a href=\"http:\/\/msdn.microsoft.com\/en-US\/vstudio\/dotnetnative\">Download the .NET Native developer preview<\/a> today and <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=393821\">tell us what you think<\/a>.\u00a0 This developer preview currently enables building apps for Windows Store on ARM and x64 architectures (stay tuned for x86.) .NET Native will soon enable a consistent and converged experience across devices. Today&#8217;s preview supports Windows Store applications. We will continue to evolve and improve native compilation for the range of .NET applications.<\/p>\n<p>.NET Native continues to provide a first-class .NET developer experience in Visual Studio. You still get a great edit\/compile\/debug environment with productivity enhancers like Edit and Continue and code refactoring. You continue to upload MSIL app packages to the Windows Store. Our compiler in the cloud compiles the app using .NET Native in the Store, creating a self-contained app package that\u2019s customized to the device where the app will be installed.<\/p>\n<p>.NET Native optimizes Store apps for device scenarios in all stages of compilation. We optimized the .NET Native runtime (a refactored and optimized CLR) to make apps start faster and consume less memory. The .NET Native compiler uses the world-class Microsoft VC++ optimizer back-end to make your app run faster. .NET Native libraries are refactored and optimized for Store apps. And .NET Native has the capability to link in library code your app uses into the app, allowing the optimizer to work globally across your app\u2019s code and library code. In the end, your app is optimized for your user\u2019s device, whatever platform, architecture, OS or form factor it might be running.\u00a0 The end result \u2013apps just get faster!<\/p>\n<p>Some of the most popular Windows Store apps on Surface devices are already running on .NET Native. This includes applications such as Wordament and Fresh Paint, which are seeing multi-second startup wins.<\/p>\n<p>Tune into the \/\/BUILD conference for more details. Also, check out the <a href=\"https:\/\/channel9.msdn.com\/Shows\/Going+Deep\/Inside-NET-Native\">Going Deep Channel 9 Video on .NET Native<\/a>.<\/p>\n<h2>Getting started with .NET Native<\/h2>\n<p>The .NET Native developer preview installs on top of <a href=\"http:\/\/www.microsoft.com\/en-us\/download\/details.aspx?id=42307\">Visual Studio 2013 Update 2 RC<\/a>.<\/p>\n<h2>Compiling with the .NET Native Toolchain<\/h2>\n<p>After your project is loaded, you can enable the .NET Native compiler. Make sure you\u2019ve configured your app to compile for a specific architecture, x64 or ARM. .NET Native compiles to native code, so you need to target a real machine type instead of Any CPU. There are a few ways to do this\u2014in the Solution Property Pages:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/3513.clip_image001_thumb_47FEE72C.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"clip_image001\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/3513.clip_image001_thumb_47FEE72C.png\" alt=\"clip_image001\" width=\"644\" height=\"192\" border=\"0\" \/><\/a><\/p>\n<p>Or in the handy dropdowns at the top of the editor window:<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/4812.clip_image002_thumb_35B6206A.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"clip_image002\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/4812.clip_image002_thumb_35B6206A.png\" alt=\"clip_image002\" width=\"644\" height=\"196\" border=\"0\" \/><\/a><\/p>\n<p>Once you\u2019ve selected a supported machine type you\u2019re ready to enable your project for .NET Native compilation. Right-click on the project name and you\u2019ll see the \u201cEnable for .NET Native\u201d option has appeared. (OK, it was always there, but if you selected it without selecting x64 or ARM you\u2019d get an error.)<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/4405.clip_image003_thumb_0E7BD735.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"clip_image003\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/4405.clip_image003_thumb_0E7BD735.png\" alt=\"clip_image003\" width=\"554\" height=\"484\" border=\"0\" \/><\/a><\/p>\n<p>Selecting this actually causes a few things to happen. First, it creates a new file for your project called \u201cdefault.rd.xml\u201d. This file contains runtime directives that help the .NET Native compiler understand what metadata and type information needs to be preserved in order for your app to run correctly, so things like reflection mostly just work, even though you are statically compiling everything!<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/5584.clip_image004_thumb_112492E6.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"clip_image004\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/5584.clip_image004_thumb_112492E6.png\" alt=\"clip_image004\" width=\"377\" height=\"484\" border=\"0\" \/><\/a><\/p>\n<p>Second, selecting \u201cEnable for .NET Native\u201d builds your app. Visual Studio will also run a static analysis tool on your app to give a quick read on whether you are using any feature that\u2019s not yet in the preview release. This will generate a \u201c.NET Native Code Generation Compatibility Report\u201d that will pop up with information about your app. Also, you can always rerun the static analysis from your project\u2019s context menu.<\/p>\n<p>If your app is like most Store apps, you\u2019ll see this in the Compatibility Report, meaning you\u2019re ready to test your app thoroughly with .NET Native.<\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/2845.clip_image005_thumb_37F2A926.png\"><img decoding=\"async\" style=\"padding-top: 0px; padding-left: 0px; padding-right: 0px; border-width: 0px;\" title=\"clip_image005\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2014\/04\/2845.clip_image005_thumb_37F2A926.png\" alt=\"clip_image005\" width=\"644\" height=\"309\" border=\"0\" \/><\/a><\/p>\n<p>If your app uses many complicated patterns or yet to be implemented features (e.g., WCF), you might instead get some workarounds and guidance. We\u2019ll dive into each and every topic but for now if you run into any issues, please send us feedback, either in <a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkID=393821\">the .NET Native forum<\/a> or by emailing us directly at <a href=\"mailto:dotnetnative@microsoft.com\">dotnetnative@microsoft.com<\/a>.<\/p>\n<p>We look forward to hearing from you! Get the new VS Update, <a href=\"http:\/\/msdn.microsoft.com\/en-US\/vstudio\/dotnetnative\">download the .NET Native Tools<\/a>, start making your apps faster and tell us what you think!<\/p>\n<p><strong>Update<\/strong>: A number of the questions that have been asked in the comments are addressed in <a href=\"http:\/\/msdn.microsoft.com\/en-US\/vstudio\/dn642499.aspx\">the .NET Native FAQ<\/a>.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This post was written by Subramanian Ramaswamy and Andrew Pardoe, Senior Program Managers on the .NET Native team. We\u2019re thrilled to announce the first release of .NET Native. Windows Store apps start up to 60% faster with .NET Native and have a much smaller memory footprint. Our first release is a Developer Preview that allows [&hellip;]<\/p>\n","protected":false},"author":11288,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685],"tags":[30,53,66,108,117,156],"class_list":["post-18468","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","tag-announcement","tag-compiler","tag-dotnetnative","tag-performance","tag-releases","tag-windows-store"],"acf":[],"blog_post_summary":"<p>This post was written by Subramanian Ramaswamy and Andrew Pardoe, Senior Program Managers on the .NET Native team. We\u2019re thrilled to announce the first release of .NET Native. Windows Store apps start up to 60% faster with .NET Native and have a much smaller memory footprint. Our first release is a Developer Preview that allows [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/18468","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/11288"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=18468"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/18468\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=18468"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=18468"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=18468"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}