【问题标题】:ASP.NEt Web API and ElmahASP.NET Web API 和 Elmah
【发布时间】:2013-09-18 08:44:45
【问题描述】:

我正在开发一个 Web API 应用程序。我遵循了 Elmah 的设置。但是,当我想通过浏览到本地计算机上的 url 来访问日志文件时,出现以下错误:

<Error>
<Message>
No HTTP resource was found that matches the request URI 'http://api.smsgh.local/elmah.axd'.
</Message>
<MessageDetail>
No type was found that matches the controller named 'elmah.axd'.
</MessageDetail>
</Error>

请帮我解决这个问题。

非常感谢

【问题讨论】:

  • 您记得添加处理 /elmah.axd 请求的 http 处理程序吗?

标签: asp.net elmah


【解决方案1】:

你需要告诉路由配置忽略*.axd:

routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

【讨论】:

    猜你喜欢
    • 2012-04-24
    • 1970-01-01
    • 2011-09-23
    • 2015-08-03
    • 2017-05-06
    • 2016-12-06
    • 1970-01-01
    • 1970-01-01
    • 2016-10-07
    相关资源
    最近更新 更多