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"
</configSections>
CTP2 config:
<section name="dcacheClient" type="System.Data.Caching.DCacheClientSection, CacheBaseLibrary"
<section name="fabric" type="System.Data.Fabric.Common.ConfigFile, FabricCommon"
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.
<dcacheClient deployment="simple" localCache="false">
<hosts>
<!--List of services -->
<host name="localhost" cachePort="22233" cacheHostName="DistributedCacheService"/>
</hosts>
</dcacheClient>
<dcacheClient deployment="simple">
<localCache isEnabled="true" sync="TTLBased" ttlValue="300" />
3) <fabric>: In this section the values of “className” and “sinkName” attributes are changed. The old and new configs for “fabric” are shown below:
<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"/>
sinkName="System.Fabric.Common.FileEventSink,FabricCommon"
sinkParam="CacheClientLog" defaultLevel="1"/>
sinkName="System.Data.Caching.ETWSink, CacheBaseLibrary"
sinkParam="" defaultLevel="-1" />
</collection>
</section>
</fabric>
<customType className="System.Data.Fabric.Common.EventLogger,FabricCommon"
sinkName="System.Data.Fabric.Common.ConsoleSink,FabricCommon"
sinkName="System.Data.Fabric.Common.FileEventSink,FabricCommon"
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>
<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)