AzureCacheSessionStoreProvider doesn work with emulator
-
martedì 15 maggio 2012 16:08
Hi!
I have setup with solutions running on my machine with 2 instances and AzureCacheSessionStoreProvider that uses cloud.
Web.config contains following:
<sessionState mode="Custom" customProvider="AzureCacheSessionStoreProvider">
<providers>
<add name="AzureCacheSessionStoreProvider" type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache" cacheName="default" useBlobMode="true" dataCacheClientName="default" sharedId="mySharedId" />
</providers>
</sessionState><section name="dataCacheClients" type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" allowLocation="true" allowDefinition="Everywhere" />
<dataCacheClients>
<dataCacheClient name="default">
<hosts>
<host name="myName.cache.windows.net" cachePort="22233" />
</hosts>
<securityProperties mode="Message">
<messageSecurity authorizationInfo="myKey" />
</securityProperties>
</dataCacheClient>
</dataCacheClients>Simple check shows that sessions are different on two instances:
if (string.IsNullOrEmpty(Session["asdf"] as string)) Session["asdf"] = Settings.InstanceName; Assert.IsTrue((Session["asdf"] as string) == Settings.InstanceName, "Different");
Code does not crash! But it works as expect when deployed to Azure.
Here in the comments I found two guys reporting the same problem.
Anyone knows how this can be cured?
Tutte le risposte
-
mercoledì 16 maggio 2012 05:58Moderatore
Hi,
Your configuration looks OK, Did you put the <configSections> at the top of the <configuration> section? And for this similar thread, it seems that some there's a existing issues in Azure emulator, the Caching service not works fine in Azure emulator with 2 or more instances, but if deploy the application on Cloud, it should works.
BR,
Arwind
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
- Contrassegnato come risposta Arwind - MSFTModerator martedì 22 maggio 2012 03:54
-
mercoledì 16 maggio 2012 06:58
Hi,
Your configuration looks OK, Did you put the <configSections> at the top of the <configuration> section? And for this similar thread, it seems that some there's a existing issues in Azure emulator, the Caching service not works fine in Azure emulator with 2 or more instances, but if deploy the application on Cloud, it should works.
BR,
Arwind
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework
Yes, everything works fine in Azure. But it turns development in real pain when you need to wait 30min to see if your code works or not.
Thank you for the link, I'll try Server AppFabric provider.
-
mercoledì 16 maggio 2012 07:57ModeratoreYes, if you still has any further issue about this problem, please inform me, Thanks.
Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

