
This is the Title of the Book, eMatter Edition
Copyright © 2007 O’Reilly & Associates, Inc. All rights reserved.
Prebuilding an ASP.NET Web Site Programmatically
|
813
{
string msg = "Report Compiler Error: " + error.ToString( );
Debug.WriteLine(msg);
Console.WriteLine(msg);
}
public override void ReportParseError(ParserError error)
{
string msg = "Report Parse Error: " + error.ToString( );
Debug.WriteLine(msg);
Console.WriteLine(msg);
}
public override void ReportProgress(string message)
{
string msg = "Report Progress: " + message;
Debug.WriteLine(msg);
Console.WriteLine(msg);
}
}
The output from a successful compilation of the CSCB web site looks like this:
Report Progress: Building directory '/CSCBWeb/App_Data'.
Report Progress: Building directory '/CSCBWeb/Role_Database'.
Report Progress: Building directory '/CSCBWeb'.
Discussion
ClientBuildManager is actually a thin wrapper around the BuildManager class, which
does most of the heavy lifting of the compilation.
ClientBuildManager makes it more
straightforward to ensure that all the important parts of the web application are
addressed, while
BuildManager gives a bit more fine-grained control. The ClientBuildManager
also allows for subscribing to AppDomain notification events such as start, shutdown,
and unload, allowing for error handling in the event that the
AppDomain is going away
during a prebuild.
To prebuild applications in ASP.NET 2.0