2

I have added a service behavior extension to the default service behavior for logging un-handled exceptions, which is working as expected.

<extensions>
    <behaviorExtensions>
    <add name="UnhandledExceptions" 
        type="MyApp.WebServices.Behaviours.Extensions.UnhandledExceptionExtention, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    </behaviorExtensions>
</extensions>

<behaviors>
  <serviceBehaviors>
    <behavior>
      <UnhandledExceptions />
    </behavior>
  </serviceBehaviors>
</behaviors>

However, when I try to add a new service into the project I get the following error:

Failed to update the configuration file

The type 'MyApp.WebServices.Behaviours.Extensions.UnhandledExceptionExtention, MyApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' registired for extention 'UnhandledExceptions ' could not be loaded. Web.config line XX

To get around this; I comment out the extension usage in the service behavior, add the service and undo the config change.

Although this is a workable solution I would rather not have to depend upon myself and other developers remembering what appears to be an unnecessary process.

Is there a way this can be fixed?

Community
  • 1
  • 1
Andy Clark
  • 3,363
  • 7
  • 27
  • 42
  • Possible duplicate of [Why isn't my custom WCF behavior extension element type being found?](http://stackoverflow.com/questions/169342/why-isnt-my-custom-wcf-behavior-extension-element-type-being-found) – Pavel Voronin Oct 07 '15 at 16:24

0 Answers0