简体   繁体   中英

Web.config error (system.serviceModel)

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.

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?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM