I'm trying to catch regular exceptions from a WCF service in a Silverlight client application. For that I've included the respective changes in my WCF service as given in this MSDN article.
But when I configure the behavior extension and use the same in endpoint behavior, the error mentioned above is coming up, and the service is not able to run due to this error.
I am putting here my configuration. Kindly suggest how can I solve this?
<extensions>
<!--Add a behavior extension within the service model-->
<!-- Here SilverlightFaultBehavior is a class in AppServiceLib namespace -->
<behaviorExtensions>
<add name="myFaultExtension"
type="AppServiceLib.SilverlightFaultBehavior,AppServiceLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
</behaviorExtensions>
</extensions>
<endpointBehaviors>
<behavior name="myFaultBehavior">
<**myFaultExtension**/>
</behavior>
</endpointBehaviors>




I ran into this same issue. The solution for me was actually provided in the aforementioned duplicate posting Hearing "element 'behavior' has invalid child element" should be ignored, but prevented from updating service reference because of it. Turned out the 'type' field is very sensitive. Ended up using the
Console.WriteLine(typeof(BetterErrorMessagesFaultBehavior).AssemblyQualifiedName);mentioned as an answer on the other post to get the exact type I needed.