在ASP.NET MVC 1.0中使用Elmah“无法执行URL”

时间:2011-05-03 12:56:25

标签: asp.net-mvc iis elmah

我已将Elmah添加到我的ASP.NET MVC(1.0)Web应用程序中。

对/elmah.axd的请求工作正常,但它们无法正确呈现。一些挖掘表明对/elmah.axd/stylesheet的请求引发了HTTP 500错误:

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.

Stack 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

我已经使用Phil Haack的RouteDebug.dll检查了路由,并且似乎没有任何问题 - Elmah请求与routes.IgnoreRoute("{resource}.axd/{*pathInfo}");中的Global.asax.cs匹配应该是 - 并且我似乎无法找到导致错误的更多信息。

我也从Elmah的任何细节链接中获得相同的“无法执行URL” - 例如:

http://mysite/myMvcApp/elmah.axd/detail?id=FDA51223-4486-4759-9075-3C5DAE82094B

有什么想法吗?

1 个答案:

答案 0 :(得分:1)

即使我在IIS7上运行,这对我也有用:

添加

<httpModules>
   ....
   <add name="FixIIS5xWildcardMappingModule" type="Elmah.FixIIS5xWildcardMappingModule, Elmah"/>
</httpModules>

web.config

here获得。

希望它有帮助...
罗布