4

したがって、他の誰かがこれを経験しているかどうかはわかりませんが、IIS 7.5Expressを介してインストールされたELMAHでasp.netWebサイトを実行すると、ELMAHはデータベースへのログ記録またはデータベースからの読み取りさえ拒否します。代わりにカッシーニを介してウェブサイトを運営していれば、すべてが順調です。エルマは魅力のように機能します...

他の誰かがこの問題を経験していますか?

4

1 に答える 1

5

これまでの説明に基づいて、私が思いつく唯一の説明は、ELMAHのモジュールとハンドラーがで<system.web>のみ登録されている可能性があることです。そのため、ASP.NET開発サーバー(Cassini)で使用されています。一方、IIS Expressは、これらのモジュールとハンドラーがの下に登録されることを想定しています<system.webServer>。以下は、ELMAH1.1で提供されるサンプルweb.configからの抜粋です。

<!-- 
    The <system.webServer> section is required for running ELMAH under Internet
    Information Services 7.0. It is not necessary for previous version of IIS.

    In general, it would be best to include it for all .NET Framework 2.0 and above
    configurations in order to have a more portable solution between various
    versions of IIS.

    IIS 5.x, IIS 6 require the modules and handlers to be declared in <system.web>
    whereas IIS 7 needs them declared here and complains if they are in fact
    declared in <system.web>. Fortunately, the
    <validation validateIntegratedModeConfiguration="false" /> entry tells IIS 7 
    not to worry about the modules and handlers declared in <system.web>.

    If you only ever want to use IIS 7, then do the following:

    1. Remove handlers and modules from <system.web>
    2. Remove the <validation validateIntegratedModeConfiguration="false" /> element
-->

<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules>
        <add name="ErrorLog" type="Elmah.ErrorLogModule, Elmah" preCondition="managedHandler" />
        <add name="ErrorFilter" type="Elmah.ErrorFilterModule, Elmah" preCondition="managedHandler" />
        <add name="ErrorMail" type="Elmah.ErrorMailModule, Elmah" preCondition="managedHandler" />
        <add name="ErrorTweet" type="Elmah.ErrorTweetModule, Elmah" preCondition="managedHandler" />
    </modules>
    <handlers>
        <add name="Elmah" path="elmah.axd" verb="POST,GET,HEAD" type="Elmah.ErrorLogPageFactory, Elmah" preCondition="integratedMode" />
    </handlers>
</system.webServer>
于 2011-01-24T00:11:22.227 に答える