编程配置Azure的客户端缓存 [英] Programmatically configure Azure cache client

查看:146
本文介绍了编程配置Azure的客户端缓存的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚通过的NuGet更新到最新的Azure dll的(ID:Microsoft.WindowsAzure.Caching版本2.0.0.0,运行时V4版本)。这让我可以配置一个共享的缓存为我的角色。

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.

问题是,当我尝试访问的内存缓存的AppFabric编程(另一个缓存,不涉及到会话)。

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();

在code编译罚款,但引发运行时错误:

The code compiles fine but throws a runtime error:

找不到方法:虚空Microsoft.ApplicationServer.Caching.DataCacheSecurity..ctor(为System.Security.SecureString)

Method not found: 'Void Microsoft.ApplicationServer.Caching.DataCacheSecurity..ctor(System.Security.SecureString)'.

如果我想借此code和我把DLL对运行版本2的作品像一个冠军。

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?

编辑:

看起来像旧的构造DataCacheSecurity不允许安全令牌更多的

Looks like the old constructor for DataCacheSecurity doesn't allow the secure token any more

<一个href=\"http://msdn.microsoft.com/en-us/library/microsoft.applicationserver.caching.datacachesecurity.datacachesecurity(v=ws.10).aspx\" rel=\"nofollow\">http://msdn.microsoft.com/en-us/library/microsoft.applicationserver.caching.datacachesecurity.datacachesecurity(v=ws.10).aspx

现在我只是有2的构造,看起来不可能指定AUTH键

Now I just have 2 constructors and looks impossible to specify the auth key

EDIT2:

我达到了微软,他们告诉我:

I reached Microsoft and they told me:

Windows Azure的缓存和Windows天青共享缓存共享相同的API,并且尽管组件名称是相同的,该组件本身是不同的,并且在不同的位置。高速缓存的NuGet包将删除共享缓存的程序集引用,并添加正确的缓存集引用。高速缓存组件都位于C:\\ Program Files文件\\微软的SDK \\的Windows Azure.NET SDK \\ 2012-10 \\参考\\文件夹中缓存

"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.

推荐答案

在这个时候,新的Azure缓存.DLL的(V2)不符合previous版本兼容。你将要选择一个版本,并确保所有供应商遵守。显然,专用缓存需要数据高速缓存的DLL V2.0。

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.

这篇关于编程配置Azure的客户端缓存的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆