Mike Taulty's Blog
Bits and Bytes from Microsoft UK
WCF, Type Names and BehaviorExtensionElement

Blogs

Mike Taulty's Blog

Elsewhere

This is one purely for a search engine. If you’re ever looking at WCF and adding a BehaviorExtensionElement in order to add custom behaviors then take care if you see an error message like;

"Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions"

It looks like a bug ( see report here and here ) in that if you use a typename like this in your config file;

<extensions>
  <behaviorExtensions>
    <add name="clientInterception"
         type="ProductsApplication.MyInspector,ProductsApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  </behaviorExtensions>
</extensions>

then you’ll see a failure whereas if you use one like this;

<extensions>
  <behaviorExtensions>
    <add name="clientInterception"
         type="ProductsApplication.MyInspector, ProductsApplication, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
  </behaviorExtensions>
</extensions>

then you can get success. Spot the difference? A single space ( after the first comma in this case ) – so one to watch out for in that the type comparison isn’t perhaps being done in the correct way here and doesn’t compare the type but, instead, the literal formatted string name.


Posted Mon, Jun 15 2009 1:10 AM by mtaulty
Filed under: ,

Comments

NewsPeeps wrote WCF, Type Names and BehaviorExtensionElement - Mike Taulty's Blog - Mike Taulty's Blog
on Sat, Jul 11 2009 6:13 PM

Thank you for submitting this cool story - Trackback from NewsPeeps