My WCF - configuration runs just fine on my developer machine. When I try to release it to the demonstration environment (another server), it will give me following error:
An error occurred creating the configuration section handler for system.serviceModel/behaviors: Extension element 'log4net' cannot be added to this element. Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions.
My configuration, which is in both cases the same:
<system.serviceModel>
<services>
<service name="UI.WS.Services.MyService" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="wsHttpBinding"
contract="UI.WS.Services.IMyService"
bindingConfiguration="WsSecurityMode">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceDebug includeExceptionDetailInFaults="true"/>
<serviceMetadata httpGetEnabled="true" />
<!-- Extension -->
<log4net />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="WsSecurityMode">
<security mode="None" />
</binding>
</wsHttpBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<extensions>
<behaviorExtensions>
<!-- Extension -->
<add name="log4net" type="UI.WS.ErrorHandling.Log4NetBehaviorExtensionElement,UI,Version=1.0.0.0,Culture=neutral,PublicKeyToken=null" />
</behaviorExtensions>
</extensions>
</system.serviceModel>
I already checked this hint, this is not the problem (and if it would be, it wouldn't run under development environment either I guess).
Any suggestions?