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.
Web Deployment Projects can run the aforementioned precompiler (aspnet_compiler.exe) as part of a build.
The precompiler takes care of parsing the .aspx, .ascx, .master files and compiling the parser generated code into assemblies. These assemblies still need JITed when the site executes. Theoretically this is where NGen could be useful, but I've never used it for server side code (a rule of thumb says that JITing is better for long running apps).
I have an old article on the aspnet_compiler here.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With