Got Error :: The type initializer for 'Microsoft.ApplicationServer.Caching.DataCacheFactoryConfiguration' threw an exception
Category: azure connectivity
sapna.y on Tue, 20 Dec 2011 05:15:36
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:
<section name="dataCacheClient" type="Microsoft.ApplicationServer.Caching.DataCacheClientSection, Microsoft.ApplicationServer.Caching.Core"
<host name="cacheapp.cache.windows.net" cachePort="22233" />
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
I have add the references :
Import the namespace:
That's it. Now when i run application, I got Error.
If any one know the solution please help me out.
MingXu-MSFT on Wed, 21 Dec 2011 05:34:23
I have replied a similar thread at:
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.