“执行 URL 失败”在 ASP.NET MVC 1.0 中使用 Elmah

发布于 2024-11-04 09:53:40 字数 1857 浏览 4 评论 0 原文

我已将 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 请求是匹配 Global.asax.cs 中的 routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); ,因为它应该是 - 但我不能似乎找到了有关导致错误的原因的更多信息。

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

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

有什么想法吗?

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.

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

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

红衣飘飘貌似仙 2024-11-11 09:53:40

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

添加

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

到您的 web.config

此处

希望它有帮助...

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文