Search code examples
c#wcfweb-configbehaviorendpointbehavior

Not able to add WCF behavor extension to endpoint behaviors


<system.serviceModel>
  <extensions>
      <behaviorExtensions>
          <add name="WSDLFlatteningExtension" type="Thinktecture.ServiceModel.Extensions.Description,Thinktecture.ServiceModel.Extensions.Description,Version=1.0.0.0,Culture=Neutral,PublicKeyToken=f0de9a190a6d23d1"/>
      </behaviorExtensions>
  </extensions>
  <behaviors>
    <endpointBehaviors>
      <behavior name="WSDLFlatteningBehavior">
          <WSDLFlatteningExtension />
      </behavior>
    </endpointBehaviors>    
  </behaviors>
</system.serviceModel>

<WSDLFlatteningExtension /> line above is not recognized in my web.config. Throws an error at runtime. I have dropped the dll in C:\windows\Assembly and also in C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE but nothing seems to be working.


Solution

  • I was able to solve the issue. It was an issue with the dll I was referencing. I had to implement BehaviorExtensionElement in that class to make it available in configuration.