4

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

http://msdn.microsoft.com/en-us/library/microsoft.applicationserver.caching.datacachesecurity.datacachesecurity(v=ws.10).aspx

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.

Jordi
  • 2,789
  • 1
  • 20
  • 35

1 Answers1

2

At this time, the new Azure cache .DLL's (v2) are not compatible with previous versions. You will want to choose one version and make sure that all of your providers comply with it. Obviously, the Dedicated cache needs v2.0 of DataCache DLLs.

Igorek
  • 15,716
  • 3
  • 54
  • 92
  • I must have spent a week on this. Did /not/ find a way for the two to co-exist. – Igorek May 29 '13 at 13:36
  • I spent 2 working days, start thinking on killing myself. Should be trivial to have session hosted by the role and consume a shared memcache service :( – Jordi May 29 '13 at 13:51
  • 1
    I've personally spoken to the Program Manager at MS who is responsible for Shared Cache and who confirmed that the DLL's are currently not compatible and they intend to make them compatible. If you can find a way to use reflection and inject your own configuration into the v2.0 of Cache DLL's, please post how you did. I decided not to risk it for production-level system – Igorek May 30 '13 at 19:32
  • Thanks Igorek, that really helps a lot. I will hold the memcache deploy until I am 100% sure. – Jordi May 31 '13 at 05:57