Elmah not working on IIS7 server(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 服务器上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Elmah 无法在 IIS7 服务器上运行


- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- SQL 临时表问题 2022-01-01