Thursday, 9 July 2009

ASP.NET Dynamic Compilation

Unlike ASP, ASP.NET doesn't have to compile each and every time it is requested. An ASP.NET page is compiled only once when an application is modified. If it is not modified, the Framework will look for the directory


\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files


to load the compiled dll.


However, if a site contains thousands of pages. Having Framework to precompile everything and store in the temp folder isn't a good choice. Here the way to chose if you want the compiler to precompile or not.
Adding CompilationMode attribute inside the <%@ Page Language="C#" %> tag at html source code view.
The attribute has Always, Auto, and Never. I believe the default is Auto :)



No comments: