Cook Computing

ASP.NET Precompilation in Whidbey

November 13, 2003 Written by Charles Cook

The project I'm currently working on uses ASP.NET. We don't like having to ship the ASPX pages in source form, not because of IP issues but because of the possibility that customers might tinker with the files and break things unintentionally, leading to support problems. We're planning to add some form of checksum approach which will detect modified pages but when Whidbey arrives we will be able to precompile our ASP.NET application.

MSDN has an article New Code Compilation Features in ASP.NET Whidbey which describes the two types of precompilation that will be available.

In-place precompilation is the simpler of the two. It allows you to manually trigger a batch compile of all the pages in the application instead of waiting until the first user accesses the application. To do this you point your browser at a special precompilation handler in your application, for example: http://localhost/mywebsitename/precompile.axd.

The second mode - precompilation for deployment - enables you to precompile the whole web application off-site and then deploy the compiled application without any source code (including HTML). Precompilation is done using a new command-line utility called aspnet_compiler.exe.