この記事で説明されている手順に従います。http://dotnetslackers.com/articles/aspnet/Getting-ELMAH-to-work-with-WCF-services.aspx ELMAHによるエラーログの設定にWCFサービスを構成します。それはVisual Studio WebサーバーでwsHttpBindingで動作しますが、IIS(5/6)でホストしてbasicHttpBindingへのバインディングを変更すると、エラーが記録されません。私は、このリンクELMAH - Exception Logging without having HttpContextで言及されているように、 "Elmah.ErrorLog.GetDefault(null).Log(new Error(ex));
"へのエラーシグナリングコードを変更しようとしましたが、それは役に立たなかった。私は何をする必要があるか分からない。助けてください。ここにWCFサービスの設定があります(私はaspnetcompatibilityのコメントをつけてコメントをつけましたが、うまくいきませんでした)。 basicHttpBindingを持つサンプルがあれば、それは非常に役に立ちます。前もって感謝します。エラーログは、basicHttpBindingを使用してIISでホストされているWCFサービスでは動作しません。
<system.serviceModel>
<!--<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />-->
<bindings>
<basicHttpBinding>
<binding name="BasicHttpEndpointBinding">
<security mode="TransportCredentialOnly">
<transport clientCredentialType="Windows" />
</security>
</binding>
</basicHttpBinding>
</bindings>
<services>
<service behaviorConfiguration="ElmahWCF.Service1Behavior" name="ElmahWCF.Service1">
<endpoint address="" binding="basicHttpBinding"
bindingConfiguration="BasicHttpEndpointBinding"
name="BasicHttpEndpoint" contract="ElmahWCF.IService1">
</endpoint>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ElmahWCF.Service1Behavior">
<!--To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment-->
<serviceMetadata httpGetEnabled="true"/>
<!--To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information-->
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>