title: Configuration Error With Custom Behaviour
body: <p>I've created a custom behaviour for use with a WCF service to log all errors to the application log. I have made a <code>BehaviorExtensionElement</code> for the behaviour: </p>
  
  <pre><code>public ErrorLoggingBehaviorExtensionElement : BehaviorExtensionElement
  {
      public ErrorLoggingBehaviorExtensionElement() { }
  
      /* - Elements removed for brevity - */
  }
  </code></pre>
  
  <p>I am attempting to apply this in my configuration as follows:</p>
  
  <p></p>
  
  <pre><code>&lt;extensions&gt;
    &lt;behaviorExtensions&gt;
      &lt;add name="errorLogging"
           type="ErrorLoggingBehaviorExtensionElement, Logging, Version=1.0.0.0, 
                 Culture=neutral, PublicKeyToken=56e8273d901d717f"/&gt;
    &lt;/behaviorExtensions&gt;
  &lt;/extensions&gt;
  
  &lt;services&gt;
    &lt;service name="TestService" behaviorConfiguration="TestServiceBehavior"&gt;
      &lt;endpoint address="" 
                binding="wsHttpBinding" 
                contract="Test_Service.ITestService"/&gt;
      &lt;endpoint address="mex" 
                binding="mexHttpBinding" 
                contract="IMetadataExchange"/&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="TestServiceBehavior"&gt;
        &lt;serviceMetadata httpGetEnabled="true"/&gt;
        &lt;errorLogging /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  </code></pre>
  
  <p></p>
  
  <p><em>NOTE: The "type" attribute on the behavior registration element is actually on a single line in my configuration file to overcome <a href="http://connect.microsoft.com/wcf/feedback/details/216431/wcf-fails-to-find-custom-behaviorextensionelement-if-type-attribute-doesnt-match-exactly" rel="nofollow noreferrer">this known issue</a>. Line-breaks have been added for your eyes.</em></p>
  
  <p>This generates the following application error when trying to view the service page:</p>
  
  <blockquote>
    <p>An error occurred creating the configuration section handler for system.serviceModel/behaviors: No parameterless constructor defined for this object.</p>
  </blockquote>
  
  <p>Removing the <code>&lt;errorLogging /&gt;</code> element makes the error disappear, but I can't see how it is related to the error being reported.</p>