Thursday, February 08, 2007

* .NET Tip #7 : ASP.NET Dynamic Code compilation trick

ASP.NET by default provides two folders from where code is recognized automatically by runtime without registering the assemblies.

The bin folder can be used to place your compiled assemblies. Any changes in these assemblies are automatically loaded by the runtime.

ASP.NET provides for another folder called App_Code folder where directly source code files can be placed which get compiled at runtime whenever accessed. They are also accessible from all the pages of the web application. Very useful for maintaining volatile custom code without compiling it every time. Runtime invokes the appropriate compiler based on the language in source code. You can't place different languages source code in directly app_code folder but by creating different subfolders, different language sources can be maintained in dedicated subfolders. The config element used to configure this is <codeSubDirectories>.

Other Posts

No comments:

Post a Comment