Jump to content
kao

Microsoft .NET Native

Recommended Posts

What happens when .NET code is statically compiled to machine code (versus runtime compiled via JIT) by the VC++ back end compiler? You get highly optimized binaries that load and run faster than .NET code ever has before. Yes, my friends, .NET has gone native! :)

Currently it's limited to Windows Store apps for ARM and x64, but judging from their presentation, they are going to extend it to all .NET Framework eventually.. :)

 

Main topic: http://msdn.microsoft.com/en-US/vstudio/dotnetnative (download link inside, might require registration).

Presentation video: http://channel9.msdn.com/Shows/Going+Deep/Inside-NET-Native

  • Upvote 3

Share this post


Link to post

Finally something new to play with !

Share this post


Link to post

I wonder what will happen with Reflection with the native files since I'm assuming they're getting rid of the high level metadata that is in IL.

Share this post


Link to post

My opinion - Reflection will stay. All the metadata will stay. Only instead of assembly with IL code you'll get assembly with x86/x64 code, similar to mixed-mode assemblies made with Managed C++. Otherwise Microsoft would break lots of .NET Framework functionality and they don't want that.

 

On the other hand, it will make reversing .NET stuff much more fun. No more n00bs with Reflexil, yeah! :D

  • Upvote 1

Share this post


Link to post

My opinion - Reflection will stay. All the metadata will stay. Only instead of assembly with IL code you'll get assembly with x86/x64 code, similar to mixed-mode assemblies made with Managed C++. Otherwise Mikocok would break lots of .NET Framework functionality and they don't want that.

 

On the other hand, it will make reversing .NET stuff much more fun. No more n00bs with Reflexil, yeah! :D

 

That sounds reasonable. Gonna be really interesting to see how they implement it all.

 

EDIT: http://msdn.microsoft.com/en-us/library/dn600640.aspx

Edited by UbbeLoL

Share this post


Link to post

"Compilation is in the cloud"

 

any comments ?

Share this post


Link to post

Where did you see that? From what I'm reading, it's 100% local on dev machine.

Issue: You don’t know if your app was compiled using .NET Native.

Resolution: If the .NET Native compiler is invoked, you'll notice longer build times, and Task Manager will show various .NET Native component processes such as ILC.exe and nutc_driver.exe. After you successfully build your project with .NET Native, you'll find the output under obj\config\ arch\projectname.ilc\out. The final native package contents can be found under bin\arch\config\AppX. The final native package contents are under \bin\arch\config\AppX if you have deployed the app.

From: http://msdn.microsoft.com/en-us/library/dn600643(v=vs.110).aspx

Share this post


Link to post

It's when you upload it to Windows store that it will be compiled by MS. Developers will of course be able to compile it on their machines.

Share this post


Link to post

I don't have x64 Windows OS so I can't test it, but I suppose this means traditional native protectors could finally invade .NET protector market with full strength. I don't really know is it a good thing...

Share this post


Link to post

0xd4d is right but I watched the video twice and still think the produced application is just an ugly Chimera !

 

I mean it's not what we have in mind about a native code machine, this is just my opinion.

Share this post


Link to post

Considering how much we talk and how little actual information we have.. Who can make a test app and compile it both 'normal' and '.NETNative'?

 

I have 64bit Win8.1 only in VMWare, but if nobody else volunteers, I'll install VisualStudio there and make a demo on Monday.

Share this post


Link to post

I am also in, What should I do ?

 

you can ask me to send you a kidney but not to install Visual Studio 2013 or Windows 8 !

Share this post


Link to post

@spudiod: that would be really nice. Even a very simple 'Hello world' application will do.

Share this post


Link to post

@kao tomorrow i'll be able to make one, had no time today to install it

Share this post


Link to post

Woop, it's about time they allowed this. Hopefully they add support for standard desktop applications and the x86 architecture as it improves. I'm also interested in the contents of the generated applications and the metadata that could be attached to it. I'm too lazy to install the SDK and produce a sample aplication though. :blum2:

Share this post


Link to post

thanks for the news kao

 

http://blogs.msdn.com/b/dotnet/archive/2014/04/02/announcing-net-native-preview.aspx

 

Edit: i have installed it, but i don't see option to use native net, anyone know if it's only for windows 8.1, i have also x64 and windows 8

 

ReEdit: umm i have see just work for store targets, then only windows 8.1 and only store apps, it's sad, we have to wait to final version to use for windows form, WPF etc..

Edited by paula3222

Share this post


Link to post

Yes, as I mentioned in the first post, currently it's limited to certain types of apps. But if you could still make a sample application, it would be really nice. Otherwise I'll spend an hour or so installing VisualStudio + few GB of updates + .NET Native in my VMWare.

Share this post


Link to post

I was trying to make an app but i was getting this error upon clicking MainPage.xaml 

alNcssZ.png

Using Visual studio 2013 on windows 8.1 with VMware 

I tried googling the error, nothing came up

Share this post


Link to post

Im propably one of the few persons who dont lile those news that much cause im one of the "reflexil-using-n00bs".

But on the other hand, it will force people to learn new things and might bring some quality to the reversing scene

Share this post


Link to post

Ooook.. After spending several hours yesterday installing all that horrid crap on that equally horrid OS, I finally managed to build something into .NETNative. That's an experience I don't want to repeat. Ever.

 

tl;dr - .NET-style metadata are gone. You get native exe+dll+mrt100_app.dll

 

How to install it.

1) You pretty much follow instructions by MS. Install VS2013 on Win8.1, install Visual Studio 2013 Update 2 RC, install .NETNative package kindly provided by JeRRy.

2) Open or create project for Windows Store app.

3) VS2013 will bug you to get Developers licence. Just hit Cancel, you don't need it for testing.

4) Right-click project and select "Enable for .NET Native"

5) Lots of magic will happen in the background, and nice MHT document will open and describe next 2 steps.

6) Select solution, in properties select correct configuration. "AnyCPU" won't do, you need either ARM or X64.

7) Then select project, and in Build properties for this configuration enable "Compile with .NET Native" toolchain.

 

Build process

1) Once you've set up configurations properly, run Build as usual.

2) If you've enabled .NET Native, in the log window you'll see something like this:

.NET Native Build starting: Several compilation stages will occur. Please be patient as this may take several minutes.

1>------ Rebuild All started: Project: App1, Configuration: Debug x64 ------
1>  App1 -> C:\123\App1\App1\bin\x64\Debug\App1.exe
1>  Loading 63 modules...
1>  Checking assembly C:\123\App1\App1\bin\x64\Debug\App1.exe

...

1>  Build succeeded.
1>      0 Warning(s)
1>      0 Error(s)
1>  
1>  Time Elapsed 00:02:27.26
1>  Compilation successful.
1>  
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
Yes, it takes 2.5 minutes to build app that does absolutely nothing.

 

Result

I tested simple SplashScreenApp from official MS code samples.

 

.NET EXE size - 35KB. Download link for EXE file: https://www.mediafire.com/?99csgohbvyiegab

.NET Native: EXE size - 4KB, DLL size - 3.6MB, mrt100_app.dll - 300KB. Download link for binaries+PDB file, so that you can explore it a bit: https://www.mediafire.com/?ac3ggddv76chcv4

These are not complete application packages, you will not be able to run them! Just explore them and see how bad is the future...

 

EDIT 2x: Typos. Lots of them. I can't type today.

Edited by kao
  • Upvote 6

Share this post


Link to post

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×
×
  • Create New...