2010-11-29 70 views
1

刚刚发现我并不需要的HttpHandler和对System.Web的HttpHandlers的,它仍然运行ELMAH上Window2008r2 MVC2项目webconfig错误500

我曾经试图整合ELMAH我MVC2项目和它的工作原理罚款在我的本地,但是当我上传到Web,这是window2008-R2。我有“500 - 内部服务器错误”。

当我从webconfig中删除httpHandler和httpHandlers时,错误消失,但elmah未运行。

请帮忙,我如何让它在2008RC上运行?

这里是我的webconfig文件:

<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"/> 
    <section name="errorTweet" requirePermission="false" type="Elmah.ErrorTweetSectionHandler, Elmah"/> 
</sectionGroup> 

... ...

<httpModules> 
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> 
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /> 
</httpModules> 


<customErrors mode="RemoteOnly" defaultRedirect="/content/error.htm" /> 

... ...

<modules runAllManagedModulesForAllRequests="true"> 
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> 
    <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" /> 
</modules> 


<handlers> 
    <add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> 
    <remove name="UrlRoutingHandler"/> 
</handlers> 

...

<security allowRemoteAccess="0" /> 

<!-- 
    quickest log method 
    --> 
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/Content/ErrorLog" /> 

...

回答

0

我要你使用的是.NET 4.0的2008箱猜测这个模块与.NET 4

兼容我所做的是下载源文件和编译为.net 4并没有问题。我目前使用.net 4.0在服务器2008上运行Elmah,所有工作都很好。

正如这里一提的是从我的web.config文件

<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> 
    <errorLog type="Elmah.SqlErrorLog, Elmah" connectionStringName="ConnectionString" /> 
    <security allowRemoteAccess="0" />  
</elmah> 
<location path="elmah.axd"> 
<system.web> 
    <authorization> 
     <deny users="?" /> 
    </authorization> 
    <httpRuntime requestLengthDiskThreshold="256" maxRequestLength="2097151" /> 
    </system.web> 
</location> 

<system.web> 
<httpHandlers> 
    <add verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" />  
</httpHandlers> 

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

<system.webServer> 
<validation validateIntegratedModeConfiguration="false"/> 
<modules runAllManagedModulesForAllRequests="true"> 
    <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah"/> 
</modules> 
<handlers> 
    <add name="Elmah" verb="POST,GET,HEAD" path="elmah.axd" type="Elmah.ErrorLogPageFactory, Elmah" /> 
</handlers> 
</system.webServer> 
0

是否HttpHandlers的摘录中的System.Web需要由您是否在IIS6确定....这是更好你保留两部分,如odyth的示例所示,这样它对IIS 6和7都可以正常工作。