Question

sapna.y on Tue, 20 Dec 2011 05:15:36


Hello,
I am practicing for Window Azure Cache.
I have created name space in Windows Azure Management Portal.
 Then use client configuration detail in App.Config file of Window Application.
I have created Window App,which  contain one class having different methods which i called on click of button from code file. 
But I received error mentioned in question at  DataCacheFactory cacheFactory = new DataCacheFactory();, this is written in public Form1(), default constructor of form.
My configuration file is as below:
<?xml version="1.0"?>
 
<configuration>
 
  <configSections>
 
    <section name="dataCacheClient" type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core"
 
         allowLocation="true" allowDefinition="Everywhere"/>
 
  </configSections>
 
 
 
  <dataCacheClient >
 
    <hosts>
 
      <host name="cacheapp.cache.windows.net" cachePort="22233" />
 
    </hosts>
 
 
 
    <securityProperties mode="Message">
 
      <messageSecurity
 
       authorizationInfo="Mytoken">
 
      </messageSecurity>
 
    </securityProperties>
 
  </dataCacheClient>
 
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
  </startup>
</configuration>
 
I have add the references :
 
Microsoft.ApplicationServer.Caching.Client.dll
Microsoft.ApplicationServer.Caching.Core.dll
Microsoft.WindowsFabric.Common.dll
Microsoft.WindowsFabric.Data.Common.dll
Import the namespace:
using Microsoft.ApplicationServer.Caching;
 
That's it. Now when i run application, I got Error.
If any one know the solution please help me out.
Thanks,

Replies

MingXu-MSFT on Wed, 21 Dec 2011 05:34:23


Hi,

I have replied a similar thread at:

http://social.msdn.microsoft.com/Forums/en-US/windowsazureconnectivity/thread/1a5d9a63-23ed-40d8-b741-c29e89bcf5a0

Please check it and see whether it helps.

Windows Azure AppFabric cache only works for Windows Azure applications. It doesn't work for a Windows application, or an ASP.NET application that is not a web role. This makes sence, as if your application is not hosted in the cloud, storing cache data on a remote server will only slow you down rather than give you performance advantages. If you want to use cache locally, you can use Windows Server AppFabric cache.

 

Best Regards,

Ming Xu.