Can we compile an asp.net 5 application by .net native?
Asked Answered
S

2

5

The role of .net native in .net ecosystem is confusing for me. I heard it is just for universal windows applications, but also heard that it is part of CoreFX. I think having the option to compile to .net native can have many advantages (including performance).

Is it possible to compile my asp.net application (specially asp.net 5) to .net native?

Selfimmolating answered 21/7, 2015 at 17:42 Comment(0)
A
5

No, you cannot. Right now, .NET Native is not for ASP.NET. I believe it's only for Universal Windows Applications. That doesn't mean that one day it won't be available, but right now it's not planned.

See related GitHub issue where ASP.NET team confirms this.

Edit 11/27/2015

Since this was posted, Microsoft has made further announcements regarding .NET Native and .NET Core. I suggest you check out Scott Hanselman's part of the keynote from the Microsoft Connect 2015 event. At the 11:22 minute mark of this excerpt video Scott shows compiling an .NET app to native code and then running it. He says it's "future work" so it appears it's not quite ready yet (I believe one of the Q&A videos from the event explained that it's in one of the dev branches on GitHub, but I'm too lazy to rewatch all the videos for you at the moment). It was unclear if this is only working for console apps at the moment or if it will run ASP.NET.

Abound answered 21/7, 2015 at 18:25 Comment(2)
There is a compiler project on github.com/dotnet/llilc. They are preparing a AOT compiler for all platforms... But that is far away.Blotchy
Can you give a brief summary of what was announced in the keynote?Iquique
S
2

As Thomas says in comments, this should be possible once LLILC is out. It targets .NET Core which is what ASP.NET 5 runs on. I am not sure if the resulting runtime can be called .NET Native per say but LLILC do has plans to natively compile IL (e.g. output by Roslyn) ahead-of-time.

Another option is ASP.NET running on CoreRT by using RyuJIT as AOT compiler. This looks closer to reality today than LLILC. Have seen some experiments in compiling ASP.NET project on CoreRT but nothing that actually works.

[.NET Native makes use of UTC compiler which compiles to run on some C++ runtime (MRT - either minimal runtime or managed runtime, cant remember, also known as Native runtime). Currently the .NET Native UWP apps are windows specific. Though .NET Native and UWP are advertised under .NET Core, this could be misleading as only in debug mode UWP targets CoreCLR, in release mode it targets native runtime which is Windows specific. LLILC/CoreRT should change that.]

Summerlin answered 30/6, 2016 at 21:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.