I have most of the the problem resolved. First, I included the ErrorHandeling.Logging.dll file which was missing. Then I began testing different scenarios including
When exceptions were thrown
Which exception was thrown
How to handel the exception
I found the following code will produce my desired results:
void Application_Error(object sender, EventArgs e)
{
// Code that runs when an unhandled error occurs
Exception ex = Server.GetLastError();
if (!string.IsNullOrEmpty(ex.Message))
{
ExceptionPolicy.HandleException(ex, "Unhandeled Exception Policy");
//Response.Redirect("Error/error.aspx");
}
}
But why do I need the If statement? After further testing I believe I know what the problem is. A System.Web.HttpException is thrown at
System.Web.CachedPathData.GetConfigPathData(String configPath)\r\n at System.Web.CachedPathData.GetVirtualPathData(VirtualPath virtualPath, Boolean permitPathsOutsideApp)\r\n at System.Web.HttpContext.GetFilePathData()\r\n at System.Web.HttpContext.GetConfigurationPathData()\r\n at System.Web.HttpContext.GetRuntimeConfig()\r\n at System.Web.Configuration.RuntimeConfig.GetConfig(HttpContext context)\r\n at System.Web.ClientImpersonationContext.Start(HttpContext context, Boolean throwOnError)\r\n at System.Web.ClientImpersonationContext..ctor(HttpContext context)\r\n at System.Web.HttpApplication.OnThreadEnter()\r\n at System.Web.HttpApplication.ResumeSteps(Exception error)
This is actually thrown twice in a row. I am using the CSSControlAdapters to reformat TreeViewControls. The exceptions are only thrown on pages containing this control. This may also effect other adapters, currently I am only working with the TreeView. So now my next step is to figure out what is causing the errors.
Jason
Programmer
Specialty Bakers, Inc.