Changes to Session State Provider Configuration (web.config) for CTP2

Some changes are needed to be done in the application's configuration (web.config) to use the session state provider with CTP2 binaries. The changes (the differences between CTP1 Yellow and CTP2 green) are listed below:

1) < configSections > : Under this tag the type attribute of "dcacheClient" and "fabric" elements are changed. The old and new values are shown below.

CTP1 config:

  <configSections>

    <section name="dcacheClient" type="System.Configuration.IgnoreSectionHandler"

      allowLocation="true" allowDefinition="Everywhere"/>

    <section name="fabric" type="System.Fabric.Common.ConfigFile, FabricCommon"

      allowLocation="true" allowDefinition="Everywhere"/>

  </configSections>

 

CTP2 config:

<configSections>

    <section name="dcacheClient" type="System.Data.Caching.DCacheClientSection, CacheBaseLibrary"

      allowLocation="true" allowDefinition="Everywhere"/>

    <section name="fabric" type="System.Data.Fabric.Common.ConfigFile, FabricCommon"

      allowLocation="true" allowDefinition="Everywhere"/>

</configSections>

2) < dcacheClient > : In CTP2 there is change in the way the “localCache” is configured. In CTP1 the localCache was just an attribue in the dcacheClient tag where as in CTP2 it is an element under dcacheClient tag to configure other paramters with the Local Cache.

CTP1 config:

<dcacheClient deployment="simple" localCache="false">

    <hosts>

      <!--List of services -->

      <host name="localhost" cachePort="22233" cacheHostName="DistributedCacheService"/>

    </hosts>

</dcacheClient>

 

CTP2 config:

<dcacheClient deployment="simple">

    <localCache isEnabled="true" sync="TTLBased" ttlValue="300" />

    <hosts>

      <!--List of services -->

      <host name="localhost" cachePort="22233" cacheHostName="DistributedCacheService"/>

    </hosts>

</dcacheClient>

3) < fabric > : In this section the values of “className” and “sinkName” attributes are changed. The old and new configs for “fabric” are shown below:

CTP1 config:

  <fabric>

    <section name="logging" path="">

      <collection name="sinks" collectionType="list">

        <customType className="System.Fabric.Common.EventLogger,FabricCommon"

                    sinkName="System.Fabric.Common.ConsoleSink,FabricCommon"

                    sinkParam="" defaultLevel="-1"/>

        <customType className="System.Fabric.Common.EventLogger,FabricCommon"

                    sinkName="System.Fabric.Common.FileEventSink,FabricCommon"

                    sinkParam="CacheClientLog" defaultLevel="1"/>

        <customType className="System.Fabric.Common.EventLogger,FabricCommon"

                    sinkName="System.Data.Caching.ETWSink, CacheBaseLibrary"

                    sinkParam="" defaultLevel="-1" />

      </collection>

    </section>

  </fabric>

 

CTP2 config:

<fabric>

    <section name="logging" path="">

      <collection name="sinks" collectionType="list">

        <customType className="System.Data.Fabric.Common.EventLogger,FabricCommon"

                    sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"

                    sinkParam="" defaultLevel="-1"/>

        <customType className="System.Data.Fabric.Common.EventLogger,FabricCommon"

      sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"

                    sinkParam="CacheClientLog" defaultLevel="1"/>

        <customType className="System.Data.Fabric.Common.EventLogger,FabricCommon"

                    sinkName="System.Data.Caching.ETWSink, CacheBaseLibrary"

                    sinkParam="" defaultLevel="-1" />

      </collection>

    </section>

  </fabric>

 

4) DLLs to copy: The names of the dlls to be used for CTP2 session state provider are CacheBaseLibrary.dll, FabricCommon.dll, ClientLibrary.dll and CASBase.dll. (The CASClient.dll which is mentioned in CTP1 blog is not available with CTP2)

 

Example web.config for CTP2:

<?xml version="1.0"?>

<configuration>

  <configSections>

    <section name="dcacheClient" type="System.Data.Caching.DCacheClientSection, CacheBaseLibrary"

      allowLocation="true" allowDefinition="Everywhere"/>

    <section name="fabric" type="System.Data.Fabric.Common.ConfigFile, FabricCommon"

      allowLocation="true" allowDefinition="Everywhere"/>

  </configSections>

  <dcacheClient deployment="simple">

    <localCache isEnabled="true" sync="TTLBased" ttlValue="300" />

    <hosts>

      <!--List of services -->

      <host name="localhost" cachePort="22233" cacheHostName="DistributedCacheService"/>

    </hosts>

  </dcacheClient>

  <fabric>

    <section name="logging" path="">

      <collection name="sinks" collectionType="list">

        <customType className="System.Data.Fabric.Common.EventLogger,FabricCommon"

                    sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"

                    sinkParam="" defaultLevel="-1"/>

        <customType className="System.Data.Fabric.Common.EventLogger,FabricCommon"

      sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"

                    sinkParam="CacheClientLog" defaultLevel="1"/>

        <customType className="System.Data.Fabric.Common.EventLogger,FabricCommon"

                    sinkName="System.Data.Caching.ETWSink, CacheBaseLibrary"

                    sinkParam="" defaultLevel="-1" />

      </collection>

    </section>

  </fabric>

  <system.web>

    <sessionState mode="Custom" customProvider="SessionStoreProvider">

      <providers>

        <add name="SessionStoreProvider" type="System.Data.Caching.SessionStoreProvider, ClientLibrary" />

      </providers>

    </sessionState>

  </system.web>

</configuration>

 

Shankar Reddy Sama

(Microsoft project code named "Velocity" Team)