다음을 통해 공유


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)

Comments

  • Anonymous
    October 29, 2008
    PingBack from http://mstechnews.info/2008/10/changes-to-session-state-provider-configuration-webconfig-for-ctp2/

  • Anonymous
    February 27, 2009
    I am having a problem using Velocity as a Session State provider.  When a user opens a browser and uses the application all is fine, when the user logs out and does not close the web browser they are using and attempts to log back in, an error is displayed. "Exception Details: System.Data.Caching.CacheException: ErrorCode<ERRCA0003>:Cache::PutAndUnlock : One of the required arguments contains a null reference." Prior to using Velocity as the session state provider we used sql server and we were not having this issue. Any ideas ?

  • Anonymous
    March 19, 2009
    Here is a collection random notes and links for Velocity. &#160; Release Schedule: CTP1: Released. CTP2