I am using Azure's Cache Service preview, following their tutorial. Things work great locally using IIS Express. However, when I deploy to the staging server, I receive the following error:
Microsoft.CSharp.RuntimeBinder.RuntimeBinderException: 'Microsoft.ApplicationServer.Caching.DataCache.DataCache(string)' is inaccessible due to its protection level
I am initializing DataCache
with the following code, which throws the above error:
_cache = new DataCache("cacheName", "configurationName");
I am using the Azure Cache NuGet package and all the DLLs look correct in the bin directory. Any help would be greatly appreciated.
This ended up being a conflict with the AppFabric role feature which was installed on the staging server (Windows 2008 R2). Once that feature was removed, the Azure Cache worked fine.