我尝试使用 SlowCheetah 扩展,但我似乎无法让它工作。我想我可能在某个地方错过了一步。
我下载了扩展并安装了它。我创建了我的 web.config 文件并进行了“添加转换”
为了测试它,我已经在我的项目中使用了 ELmah,所以我尝试给它不同的电子邮件地址来发送每个配置的错误日志,并且在 web.config 中没有。
网络配置
<elmah>
<security allowRemoteAccess="0"/>
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="C:\myLogPath"/>
<errorFilter>
<test>
<or>
<equal binding="HttpStatusCode" value="404" type="Int32"/>
<is-type binding="BaseException" type="System.FieldAccessException" />
</or>
</test>
</errorFilter>
</elmah>
web.debug.config
<elmah>
<errorMail from="error-debug@domain.tld" to="me@domain.tld" priority="High" xdt:Transform="Insert"/>
</elmah>
因此,当我查看“预览转换”时,结果似乎是我想要的。然后我启动我的应用程序(使用 F5 或 ctrl+F5)并故意在我的网站上抛出异常以触发 Elmah 错误报告,但我从未收到任何电子邮件。如果我在 web.config 中添加 errorMail 行,我会收到一封电子邮件,所以问题不是来自 Elmah。
正如我所说,我觉得我可能错过了设置扩展的一个简单步骤。