Reputation: 12441
I'm trying to get AppFabric working in my Asp.net application, everything works fine if I use c# code to do the configuration. But I'm having a real hard time to get it to work from web.config. If I have the following in the web.config,
<section name="dataCacheClient"
type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
/>
and
<dataCacheClient>
<hosts>
<host name="localhost" cachePort="22233" />
</hosts>
</dataCacheClient>
then my code does not throw exceptions, HOWEVER doing put to the default cache does not actually put anything into the cache, byte count is 0.
If I change the web.config to
<section name="dataCacheClients"
type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
/>
notice the it's "dataCacheClients" with an "s" and
<dataCacheClients>
<dataCacheClient name="default">
<hosts>
<host name="localhost" cachePort="22233" />
</hosts>
</dataCacheClient>
I got exception
ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty
Could someone help point out what I'm missing here.
Thank you so much!
Upvotes: 0
Views: 2625
Reputation: 278
Your first example is correct, just add parameters: allowLocation="true" allowDefinition="Everywhere".
<section name="dataCacheClient"
type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35"
allowLocation="true"
allowDefinition="Everywhere"/>
Upvotes: 1