2

Any help why this error happens?

Thank you!!!

An error occurred creating the configuration section handler for system.serviceModel/behaviors: Extension element 'cookieManager' cannot be added to this element. Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions. Parameter name: element

web.config

<system.serviceModel>
    <behaviors>
      <endpointBehaviors>
        <behavior name="EnableCookieManager">
          <cookieManager/>
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <extensions>
      <behaviorExtensions>
        <add name="cookieManager" type="App1.Web.Cookie.CookieManagerBehaviorExtension, App1, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
      </behaviorExtensions>
    </extensions>

This example have been used.

NoWar
  • 36,338
  • 80
  • 323
  • 498
  • 1
    Just a guess, but I would say that you need the extension registration before the behaviors section. aka. Swap behaviors and extensions order in the config. – user957902 May 23 '12 at 21:36

1 Answers1

5

You need to ensure the type name is exactly equivalent to typeof(CookieManagerBehaviorExtension).AssemblyQualifiedName

Also, if you use the WCFService Config Editor to add the behavior extension, you can just browse for the DLL & class and it then sets all the proper information to your configuration file, just in case you got it slightly wrong?

Chris
  • 2,471
  • 25
  • 36