.net - How to add custom WCF behavior extension to machine.config -


i'm trying implement own version of custom behavior shown here: using windows credentials in wcf-custom adapter , here: impersonate wcf credentials when calling wcf service

biztalk requires put in gac, did running gacutil.

i attempted following changes machine.config, , know didn't work because if restart biztalk host instance, bizarre errors.

changed this:

  <section name="extensions" type="system.servicemodel.configuration.extensionssection, system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089"/> 

to this:

  <section name="extensions" type="system.servicemodel.configuration.extensionssection, system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089">     <add name="windowscredentialsbehaviour" type="myapp.biztalk.wcf.extensions.impersonatebasiccredentialsbehaviour, myapp.customendpointbehavior, version=1.0.0.0, culture=neutral, publickeytoken=b12735283a466be4" />   </section> 

in biztalk, assembly looks this:

myapp.customendpointbehavior, version=1.0.0.0, culture=neutral, publickeytoken=b12735283a466be4"

so have 2 main questions:

  1. i'm not sure why in config file there 2 names, 1 class or behavior name, , second assembly name?
  2. what did wrong?

here namespaces:

namespace myapp.biztalk.wcf.extensions {     public class impersonatebasiccredentialsbehaviour : iendpointbehavior ... namespace myapp.biztalk.wcf.extensions {     public class impersonatebasiccredentialsbehaviourelement : behaviorextensionelement ... 

i tried edit machine.config sdk tool: svcconfigeditor.exe, gave error, left edit in notepad++.

enter image description here

you don't need define section (it's defined). instead, configure extension in machine level configuration:

<system.servicemodel>     <extensions>         <behaviorextensions>             <add name="windowscredentialsbehaviour" type="myapp.biztalk.wcf.extensions.impersonatebasiccredentialsbehaviour, asurion.customendpointbehavior" />         </behaviorextensions>     </extensions> </system.servicemodel> 

it merge application's configuration file utilizes wcf (system.servicemodel). need make sure type myapp.biztalk.wcf.extensions.impersonatebasiccredentialsbehaviour in assembly available application wants use wcf (either in gac or in private bin path).


Comments