gpt4 book ai didi

asp.net-mvc - Elmah,转换为 .Net4 vs2010,在服务器 2008 上运行,不起作用

转载 作者:行者123 更新时间:2023-12-02 02:23:30 25 4
gpt4 key购买 nike

所以我一直在使用 elmeh。

我有一个应用程序,我最近转换为 MVC3 .net4 和 vs2010,它是在服务器 2008 机器上开发的(与我在 XP 机器上开发的其他应用程序相反)。

我正常设置了 elmah 但它不起作用...

我已经得到了对 ELMAH.dll 的引用,它在我的 CommonDLLs 文件夹中。

我添加了分区

<sectionGroup name="elmah">
<section name="security" requirePermission="false" type="Elmah.SecuritySectionHandler, Elmah" />
<section name="errorLog" requirePermission="false" type="Elmah.ErrorLogSectionHandler, Elmah" />
<section name="errorMail" requirePermission="false" type="Elmah.ErrorMailSectionHandler, Elmah" />
<section name="errorFilter" requirePermission="false" type="Elmah.ErrorFilterSectionHandler, Elmah" />
</sectionGroup>

我添加部分

<elmah>
<security allowRemoteAccess="1" />
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/ELMAH" />
<!--<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />-->
<errorMail from="change.me@CCCC.org" to="brown.ericw@CCCC.org" subject="Application: StudentPortal3G, Environment:Dev, ServerBoxName: Dev" async="true" />
</elmah>

我添加模块和处理程序

<httpHandlers>
<add verb="*" path="*.pdfx" type="JCDCHelper.Web.UI.RunAsASPXHandler, JCDCHelper.Web" />
<add verb="*" path="*.mvc" validate="false" type="System.Web.Mvc.MvcHttpHandler, System.Web.Mvc, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
<add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />
</httpHandlers>
<httpModules>
<add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" />
<add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" />
</httpModules>

我为电子邮件支持添加了 SMTP 部分

 <system.net>
<!--Required for Elmah Mail Processing-->
<mailSettings>
<smtp deliveryMethod="Network">
<network host="10.10.10.10" port="25" defaultCredentials="true" />
</smtp>
</mailSettings>
</system.net>

我转到“~\ELMAH”文件夹,选择我的机器,并授予网络服务帐户对该文件夹的完全控制权(为每个人做同样的事情,以防万一)

我为 elmah.axd 设置了路由,使其作为网页通过。

    routes.IgnoreRoute("elmah.axd");

我添加了一个位置标签,这样我就可以在不登录的情况下访问 elmah.axd

<location path="elmah.axd">
<system.web>
<authorization>
<!--<deny users="?" /> in prod and qa change to this, otherwise anyoen can look at the logs - EWB-->
<allow users="*" />
</authorization>
</system.web>
</location>

但我什么也没得到,没有 elmah 电子邮件,ELMAH 文件夹中没有 XML 日志,当我转到 elmah.axd 时出现 404

我错过了什么?欢迎提供任何帮助。

谢谢,

卡尔-

最佳答案

在IIS7下你需要在web.config的system.webserver节点下添加httpHandlers和httpModula。

此线程应该有所帮助:http://groups.google.com/group/elmah/browse_thread/thread/4bbef2f26e0c5fd1

关于asp.net-mvc - Elmah,转换为 .Net4 vs2010,在服务器 2008 上运行,不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7045645/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com