Elmah 无法在 IIS7 服务器上运行 [英] Elmah not working on IIS7 server

查看:43
本文介绍了Elmah 无法在 IIS7 服务器上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的 MVC 3 站点上运行 Elmah,并且在我的本地开发机器上运行一切.

I have Elmah running on my MVC 3 site, and have everything working on my local development machine.

但是,现在我已将网站移至生产服务器,Elmah 无法正常工作.我在实时服务器上使用与在本地计算机上使用相同的 SQL 帐户(和连接字符串).EF4 连接(与 Elmah 相同)工作正常.

However, now that I've moved my site to my production server, Elmah is not working. I am using the same SQL account (and connection string) on my live server as I'm using on my local machine. The EF4 connection (same as Elmah) works just fine.

我在偶数日志或 SQL 事件探查器中看不到任何内容.我也没有在 SQL 日志中看到任何错误.

I don't see anything in the Even Logs or in SQL Profiler. I don't see any errors in the SQL logs either.

对可能发生的事情有什么想法,或者我该如何解决这个问题?

Any ideas on what could be happening, or how I could troubleshoot this?

提前致谢.

推荐答案

ELMAH 正在使用 HttpModule 来记录错误.对于 IIS6,HttpModules 在 web.config 文件中的 System.Web 下注册.但是,对于 IIS7+,应该在 system.webserver 命名空间下注册 HttpModules.嵌入式开发 Web 服务器将使用 IIS6 配置.

ELMAH is using a HttpModule to log errors. For IIS6, HttpModules are registered under System.Web in the web.config file. However, for IIS7+, HttpModules should be registered under the system.webserver namespace. The embedded development web server will use the IIS6 config.

IIS6:

  <system.web>
    <httpModules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    </httpModules>
  </system.web>

IIS7:

  <system.webServer>
    <modules>
      <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
    </modules>
  </system.webServer>

这篇关于Elmah 无法在 IIS7 服务器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆