I have been searching for days for an answer to this issue. I have found a few sites through Google where Google listed my error in the sample text only to discover that the same text does not actually exist in the page (this happened several times) or it turned out to be a different issue (with an easy fix that didn't work for me).
I am using Elmah in an ASP.NET web form project (v3.5). Elmah is working great, and successfully logging (in a SQL database). In the Global class, I am capturing the ErrorID in the Logged event handler and calling a couple of methods in a custom class.
protected void errorLog_Logged(object sender, ErrorLoggedEventArgs e) { ElmahLogManager logMgr = new ElmahLogManager(e.Entry, HttpContext.Current); logMgr.LogErrorDetails(); string errorPageUrl = logMgr.GetErrorPageUrl(); if (!string.IsNullOrEmpty(errorPageUrl)) { Response.Redirect(errorPageUrl); } }
For your reference, the first method (LogErrorDetails) logs extra details such as Session variables, and the second method (GetErrorPageUrl) returns the url with the ErrorID as a parameter. Both of these methods are working. The session data is being logged, and the url is returned (such as: "ErrorPage.aspx?id=DB9AFF21-A614-446E-8FF1-E35CFBE56C57").
The problem I am having is when the redirect happens, an System.Web.HttpException is thrown which of course logs a new error which raises this event again, and the whole thing happens over and over until the system says it's had enough that quits the loop.
The specific error I am getting is:
Error parsing attribute 'title': The 'title' property is read-only and cannot be set.
The error page is never reached (i.e. a breakpoint at the beginning of Page_Load or OnInit are never reached).
The stack trace doesn't show anything useful (to me), but in case it does to you, here it is:
System.Web.HttpParseException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set. ---> System.Web.HttpParseException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set. ---> System.Web.HttpException: Error parsing attribute 'title': The 'title' property is read-only and cannot be set. at System.Web.UI.TemplateParser.ProcessError(String message) at System.Web.UI.TemplateControlParser.ProcessUnknownMainDirectiveAttribute(String filter, String attribName, String value) at System.Web.UI.PageParser.ProcessUnknownMainDirectiveAttribute(String filter, String attribName, String value) at System.Web.UI.TemplateParser.ProcessMainDirective(IDictionary mainDirective) at System.Web.UI.TemplateControlParser.ProcessMainDirective(IDictionary mainDirective) at System.Web.UI.TemplateParser.ProcessDirective(String directiveName, IDictionary directive) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVirtualPathObjectFactory(VirtualPath virtualPath, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp, Boolean noAssert) at System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) at System.Web.HttpApplication.MapHttpHandler(HttpContext context, String requestType, VirtualPath path, String pathTranslated, Boolean useAppConfig) at System.Web.HttpApplication.MapHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Does anyone have any ideas on how I might fix this problem?