"Failed to execute URL" using Elmah in ASP.NET MVC 1.0
I've added Elmah to my ASP.NET MVC (1.0) web application.
Requests to /elmah.axd are working fine, but they don't render correctly. A bit of digging shows that the request to /elmah.axd/stylesheet is throwing an HTTP 500 error:
Failed to Execute URL.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Web.HttpException: Failed to Execute URL.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
St开发者_Go百科ack Trace:
[HttpException (0x80004005): Failed to Execute URL.]
System.Web.Hosting.ISAPIWorkerRequestInProcForIIS6.BeginExecuteUrl(String url, String method, String childHeaders, Boolean sendHeaders, Boolean addUserIndo, IntPtr token, String name, String authType, Byte[] entity, AsyncCallback cb, Object state) +2003857
System.Web.HttpResponse.BeginExecuteUrlForEntireResponse(String pathOverride, NameValueCollection requestHeaders, AsyncCallback cb, Object state) +393
System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state) +220
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +8682818
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +155
I've checked the routing using Phil Haack's RouteDebug.dll and there doesn't appear to be any problems there - the Elmah request is matching the routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
in Global.asax.cs
as it should be - and I can't seem to find any more information on what's causing the error.
I get the same "Failed to execute URL" from any of the detail links in Elmah as well - such as:
http://mysite/myMvcApp/elmah.axd/detail?id=FDA51223-4486-4759-9075-3C5DAE82094B
Any ideas?
This worked for me even though I'm running on IIS7:
Add
<httpModules>
....
<add name="FixIIS5xWildcardMappingModule" type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>
</httpModules>
to your web.config
Got it from here.
Hope it helps...
Rob
精彩评论