<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: QMSAPI v10SR5 vs V11SR2 ServiceKeyBehaviorExtensionElement in QlikView</title>
    <link>https://community.qlik.com/t5/QlikView/QMSAPI-v10SR5-vs-V11SR2-ServiceKeyBehaviorExtensionElement/m-p/393036#M1273833</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Invoke the folloiwng before any QMSAPI calls. It will update the in-memory configuration information to the current assembly version and avoid the exception in this discussion.&lt;/P&gt;&lt;P&gt;public UpdateServeKeyBehaviorType()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);&lt;BR /&gt;&amp;nbsp; ServiceModelSectionGroup smGroup = ServiceModelSectionGroup.GetSectionGroup(configuration);&lt;BR /&gt;&amp;nbsp; ExtensionElementCollection extensions = ServiceModelSectionGroup.GetSectionGroup(configuration).Extensions.BehaviorExtensions;&lt;BR /&gt;&amp;nbsp; ExtensionElement behavior = extensions["serviceKeyBehavior"];&lt;BR /&gt;&amp;nbsp; //myNameSpace.ServiceKeyBehaviorExtensionElement, myAssembly, Version=1.0.4723.26787, Culture=neutral, PublicKeyToken=null&lt;BR /&gt;&amp;nbsp; string oldType = behavior.Type;&lt;BR /&gt;&amp;nbsp; string newType = oldType.Substring(0, oldType.IndexOf("Version=") + &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; + AssemblyVersion() + oldType.Substring(oldType.IndexOf(", Culture"));&lt;BR /&gt;&amp;nbsp; behavior.Type = newType;&lt;BR /&gt;&amp;nbsp; configuration.Save();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public string AssemblyVersion()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; string[] pieces = Assembly.GetEntryAssembly().FullName.Split(new char[] { '=', ',' });&lt;BR /&gt;&amp;nbsp; return (pieces.Count() &amp;gt; 2 ? pieces[2] : string.Empty);&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Dec 2012 15:38:10 GMT</pubDate>
    <dc:creator />
    <dc:date>2012-12-07T15:38:10Z</dc:date>
    <item>
      <title>QMSAPI v10SR5 vs V11SR2 ServiceKeyBehaviorExtensionElement</title>
      <link>https://community.qlik.com/t5/QlikView/QMSAPI-v10SR5-vs-V11SR2-ServiceKeyBehaviorExtensionElement/m-p/393035#M1273832</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Using QMSAPI from V10SR5 I built an app that was able to inject a service key using the following in my app.config&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;behaviorExtensions&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="serviceKeyBehavior" type="TerraTechnology.AnalyticModuleLoader.ServiceKeyBehaviorExtensionElement, AnalyticModuleLoader"/&amp;gt;&lt;BR /&gt;&amp;lt;/behaviorExtensions&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note that the "type=..." is NOTa fully qualified assembly name; it does not have Version=xxx, Culture=xxx, PublicKeyToken=xxx.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It appears that when I use v11SR2 and I try to use the above abbreviated assembly qualifier I get an error: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;An exception occurred: An error occurred creating the configuration section handler for system.serviceModel/behaviors: Extension element 'serviceKeyBehavior' cannot be added to this element.&amp;nbsp; Verify that the extension is registered in the extension collection at system.serviceModel/extensions/behaviorExtensions.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I use a fully qualified assembly description in the app.config&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;lt;behaviorExtensions&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="serviceKeyBehavior" type="TerraTechnology.AnalyticModuleLoader.ServiceKeyBehaviorExtensionElement, AnalyticModuleLoader, Version=4.2.4716.29448, Culture=neutral, PublicKeyToken=null"/&amp;gt;&lt;BR /&gt;&amp;lt;/behaviorExtensions&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do not get an error.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am wondering if there was a change in the way QMSAPI tries to create an instance of the type specified in the behaviorExtensions between v10 and v11.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 26 Jan 2026 18:19:17 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QMSAPI-v10SR5-vs-V11SR2-ServiceKeyBehaviorExtensionElement/m-p/393035#M1273832</guid>
      <dc:creator />
      <dc:date>2026-01-26T18:19:17Z</dc:date>
    </item>
    <item>
      <title>Re: QMSAPI v10SR5 vs V11SR2 ServiceKeyBehaviorExtensionElement</title>
      <link>https://community.qlik.com/t5/QlikView/QMSAPI-v10SR5-vs-V11SR2-ServiceKeyBehaviorExtensionElement/m-p/393036#M1273833</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Invoke the folloiwng before any QMSAPI calls. It will update the in-memory configuration information to the current assembly version and avoid the exception in this discussion.&lt;/P&gt;&lt;P&gt;public UpdateServeKeyBehaviorType()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; Configuration configuration = ConfigurationManager.OpenExeConfiguration(ConfigurationUserLevel.None);&lt;BR /&gt;&amp;nbsp; ServiceModelSectionGroup smGroup = ServiceModelSectionGroup.GetSectionGroup(configuration);&lt;BR /&gt;&amp;nbsp; ExtensionElementCollection extensions = ServiceModelSectionGroup.GetSectionGroup(configuration).Extensions.BehaviorExtensions;&lt;BR /&gt;&amp;nbsp; ExtensionElement behavior = extensions["serviceKeyBehavior"];&lt;BR /&gt;&amp;nbsp; //myNameSpace.ServiceKeyBehaviorExtensionElement, myAssembly, Version=1.0.4723.26787, Culture=neutral, PublicKeyToken=null&lt;BR /&gt;&amp;nbsp; string oldType = behavior.Type;&lt;BR /&gt;&amp;nbsp; string newType = oldType.Substring(0, oldType.IndexOf("Version=") + &lt;span class="lia-unicode-emoji" title=":smiling_face_with_sunglasses:"&gt;😎&lt;/span&gt; + AssemblyVersion() + oldType.Substring(oldType.IndexOf(", Culture"));&lt;BR /&gt;&amp;nbsp; behavior.Type = newType;&lt;BR /&gt;&amp;nbsp; configuration.Save();&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;public string AssemblyVersion()&lt;BR /&gt;{&lt;BR /&gt;&amp;nbsp; string[] pieces = Assembly.GetEntryAssembly().FullName.Split(new char[] { '=', ',' });&lt;BR /&gt;&amp;nbsp; return (pieces.Count() &amp;gt; 2 ? pieces[2] : string.Empty);&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Dec 2012 15:38:10 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QMSAPI-v10SR5-vs-V11SR2-ServiceKeyBehaviorExtensionElement/m-p/393036#M1273833</guid>
      <dc:creator />
      <dc:date>2012-12-07T15:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: QMSAPI v10SR5 vs V11SR2 ServiceKeyBehaviorExtensionElement</title>
      <link>https://community.qlik.com/t5/QlikView/QMSAPI-v10SR5-vs-V11SR2-ServiceKeyBehaviorExtensionElement/m-p/393037#M1273834</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Bug in .NET 3.5&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The behaviorExtension for QMSAPI serviceKeyBehavior must be be strongly typed, i.e. must contain Version/Culture/PublicKeyToken that exactly match the assembly. No extra spaces allowed. Version etc must be specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;behaviorExtensions&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="serviceKeyBehavior" type="MyNamespace.ServiceKeyBehaviorExtensionElement, MyAssembly, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/behaviorExtensions&amp;gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This causes problems when the version of the assembly is autoincremented during assembly compile/build.&lt;/P&gt;&lt;P&gt;Fixed in .NET 4.0. Version/Culture/PublicKeyToken may be dropped so that the config no longer needs the autoincremented value of the version.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;lt;behaviorExtensions&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;add name="serviceKeyBehavior" type="MyNamespace.ServiceKeyBehaviorExtensionElement, MyAssembly"/&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/behaviorExtensions&amp;gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Dec 2012 21:37:39 GMT</pubDate>
      <guid>https://community.qlik.com/t5/QlikView/QMSAPI-v10SR5-vs-V11SR2-ServiceKeyBehaviorExtensionElement/m-p/393037#M1273834</guid>
      <dc:creator />
      <dc:date>2012-12-10T21:37:39Z</dc:date>
    </item>
  </channel>
</rss>

