locked
ConfigurationErrorException in the BehaviorExtensionElement class RRS feed

  • Question

  •  

    I am having a problem with migrating a service behavior extension from FebCTP to the JuneCTP version. The following is a configuration part of my service behavior extension. 

     <behaviors>
          <serviceBehaviors>
              <behavior name="myBehavior" >
                  <storage name="LocalStorage" />
              </behavior>
          </serviceBehaviors>
      </behaviors>

      <extensions>
         <behaviorExtensions>
             <add name="storage" type="StorageBehaviorElement, Storage"/>
         </behaviorExtensions>
      </extensions>

     

    After changes in my StorageBehaviorElement class such as using a BehaviorExtensionElement base clase, I am having the following error: 

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

    It looks like my extension is not properly registered in the behaviorExtensions collection.

    Can anyone help? Thanks in advance.

     Roman

    Tuesday, July 4, 2006 9:23 PM

Answers

  •  

    I figured out (thanks to Reflector) this problem. The JuneCTP version requires to use an assembly qualified name. The following is a correct behaviorExtensions configuration:  

    <extensions>
     <behaviorExtensions>
       <add name="storage"
    type="StorageBehaviorElement, Storage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
     </behaviorExtensions>
    </extensions>

     

    Roman

    Wednesday, July 5, 2006 12:02 AM

All replies

  •  

    I figured out (thanks to Reflector) this problem. The JuneCTP version requires to use an assembly qualified name. The following is a correct behaviorExtensions configuration:  

    <extensions>
     <behaviorExtensions>
       <add name="storage"
    type="StorageBehaviorElement, Storage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
     </behaviorExtensions>
    </extensions>

     

    Roman

    Wednesday, July 5, 2006 12:02 AM
  •  Though I have used fully qualified assembly name I still get the issue, any hints??

    I figured out (thanks to Reflector) this problem. The JuneCTP version requires to use an assembly qualified name. The following is a correct behaviorExtensions configuration:  

    <extensions>
     <behaviorExtensions>
       <add name="storage"
    type="StorageBehaviorElement, Storage, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/>
     </behaviorExtensions>
    </extensions>

     

    Roman


    Wednesday, August 7, 2013 9:10 AM