Possible duplicate:
Element behavior has invalid myFaultExtension child element in wcf app.config
I am trying to implement error creation and handling in Silverlight . ( This project works on my machine.)
I get a Visual Studio warning:
The behavior element has an invalid child element, betterErrorMessagesFaults.
Other answers elsewhere say that I should just ignore it, but I cannot, because I cannot update the service link in the non.Web project (the one that has all the xaml files). When I try, I get this error:
Parser error message: type "MyProject.Web.Services.BetterErrorMessagesFaultBehavior, MyProject.Web.Services, Version = 1.0.0.0, Culture = neutral, PublicKeyToken = null" registered for the extension "betterErrorMessagesFaults" cannot be loaded.
Here is the relevant part of Web.config:
<system.serviceModel> <extensions> <behaviorExtensions> <add name="betterErrorMessagesFaults" type="MyProject.Web.Services.BetterErrorMessagesFaultBehavior, MyProject.Web.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/> </behaviorExtensions> </extensions> <services> <service name="MyProject.Web.Services.Service2"> <endpoint address="" binding="customBinding" bindingConfiguration="MyProject.Web.Services.Service2.customBinding0" contract="MyProject.Web.Services.Service2" behaviorConfiguration="BetterErrorMessagesFaultBehavior"/> <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> </service> </services> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" /> <serviceDebug includeExceptionDetailInFaults="true" /> <dataContractSerializer maxItemsInObjectGraph="2147483647" /> </behavior> </serviceBehaviors> <endpointBehaviors> <behavior name="BetterErrorMessagesFaultBehavior"> <betterErrorMessagesFaults/> </behavior> </endpointBehaviors> </behaviors> <bindings> <customBinding> <binding name="MyProject.Web.Services.Service2.customBinding0"> <binaryMessageEncoding> <readerQuotas maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxDepth="2147483647" maxNameTableCharCount="2147483647" maxStringContentLength="2147483647" /> </binaryMessageEncoding> <httpTransport maxBufferPoolSize="2147483647" maxReceivedMessageSize="2147483647" maxBufferSize="2147483647" /> </binding> </customBinding> </bindings> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> </system.serviceModel>
BetterErrorMessagesFaultBehavior is just a copy of the class folders here on MSDN ; with only the name changed (I also tried using the default name), and the namespace was changed to MyProject.Web.Services .
I also tried to exchange
<add name="betterErrorMessagesFaults" type="MyProject.Web.Services.BetterErrorMessagesFaultBehavior, MyProject.Web.Services, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
from
<add name="betterErrorMessagesFaults" type="MyProject.Web.Services.BetterErrorMessagesFaultBehavior, MyProject.Web.Services"/>
but there was no effect. I read that it is extremely sensitive to spaces, etc., but I do not see the problem areas. I also looked at AssemblyInfo, and version 1.0.0.0, the culture is just empty (""), and I donβt know what PublicKeyToken is for, but I suspect that this is not a problem ...
So, I'm at a dead end, I donβt know where to look further.