Search code examples
c#asp.net.netahead-of-time-compile

ASP.NET Ahead of Time Compilation


Does .NET natively support Ahead of Time Compilation? I see that Mono has done this to avoid JITing issues on other platforms (IPhone for example), and was wondering if its possible to build dll's to native code and run those in IIS. For dev, I would really like to be able to flip a switch on VS and IIS, so I only have to wait once for compilation instead of compile wait, JIT wait.


Solution

  • You can pre-compile to IL, but not native code; NGEN isn't compatible with web sites, due to the way they are loaded into IIS.

    In addition to Web Deployment Projects, which will let you merge your entire site into a single DLL, you can also use a "web application" project, which uses client-side compilation, instead of a "web site" project, which does server-side compilation.