Precompiling ASP.NET Sites
Precompiling is a new option of the .NET 2.0 framework. Sites can be precompiled so that whenever a user first enters the web page, the site is already compiled with the changes. Previously, whenever a 1.1 framework page was first accessed, there was a performance decrease because the page had to be compiled on the initial load. With precompiling, this performance decrease isn't an issue.
However, you have to keep in mind that you can't change the content for ASPX pages dynamically; instead, you have to recompile everytime you make changes to a compiled file. This is because precompiled ASPX files no longer store the HTML in the file; rather the file is a "stub" or "marker", noting that the file exists, but the code is retrieved from a DLL. If you look in a precompiled site's bin folder, you will notice a lot more compiled files and dlls than you do under normal build circumstances. That is because this usually occurs on the fly.
I created a batch file to do the creation for me, because it involves using the framework's aspnet_compiler executable to do the creation. This utility uses either the physical (-p) or virtual (-v) path (as well as other options), and the folder to output to as the second parameter. I also included a remove directory command because precomiling requires a new folder, and as such, my script looks like this:
rd /s /q c:\precompiled_site
<path to 2.0 framework>\aspnet_compiler -v virtualFolder c:\precompiled_site
pause
See this for more details: http://msdn2.microsoft.com/en-us/library/ms229863.aspx