System.Web.Compilation
I'm probably late to the show on this feature too, but I just stumbled across the System.Web.Compilation library. The ClientBuildManager has like the simplest API I think I've come across - could this be any easier?
private void button1_Click(object sender, EventArgs e)
{
String SourceDirectory = @"C:\WebSites\CocoaPuffs";
String VirtualDirectory = "/Cuckoo";
String TargetDirectory = @"C:\Inetpub\wwwroot\Cuckoo";
ClientBuildManager Manager =
new ClientBuildManager(VirtualDirectory, SourceDirectory, TargetDirectory, null);
Manager.PrecompileApplication();
}