I just updated via nuGet to the latest Azure dll's (Id: Microsoft.WindowsAzure.Caching version 2.0.0.0, runtime version v4). That allowed me to configure a shared cache for my roles.
The problem is when I try to access to the AppFabric Memcache programmatically (another cache, not related to the session).
var servers = new List<DataCacheServerEndpoint>();
servers.Add(new DataCacheServerEndpoint(_hostname, _cacheport));
var conf = new DataCacheFactoryConfiguration();
conf.SecurityProperties = new DataCacheSecurity(secure(_authinfo));
var dataCacheFactory = new DataCacheFactory(conf);
_dataCache = dataCacheFactory.GetDefaultCache();
The code compiles fine but throws a runtime error:
Method not found: 'Void Microsoft.ApplicationServer.Caching.DataCacheSecurity..ctor(System.Security.SecureString)'.
If I take this code and I put the dll's to runtime version 2 works like a champ.
Any idea what should I change in order to make it work?
Edit:
Looks like the old constructor for DataCacheSecurity doesn't allow the secure token any more
Now I just have 2 constructors and looks impossible to specify the auth key
Edit2:
I reached Microsoft and they told me:
“Windows Azure Caching and Windows Azure Shared Caching share the same API, and although the assembly names are the same, the assemblies themselves are different and are in different locations. The Caching NuGet package will remove the Shared Caching assembly references and add the correct Caching assembly references. The Caching assemblies are located in the C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\2012-10\ref\Caching folder.”
conclusion: it is not possible at the moment.