这是我正在创建Factory和缓存客户端的代码:
var cacheFactoryConfig = new DataCacheFactoryConfiguration
{
ChannelOpenTimeout = TimeSpan.FromMinutes(2),
TransportProperties = {ReceiveTimeout = TimeSpan.FromSeconds(45)}
};
DataCacheFactory cacheFactory;
try
{
cacheFactory = new DataCacheFactory(cacheFactoryConfig);// <--stops here
}
catch (Exception e)
{
Trace.WriteLine(string.Format("--> Message-> {0}; --> Stack Trace->{1}", e.Message, e.StackTrace));
throw;
}
cacheClient = cacheFactory.GetDefaultCache();
服务配置:
在web.config中缓存客户端和服务器配置
如果需要,我会提供任何其他信息,以便尽快解决问题。
------编辑1 ------------------
由于相关帖子Making Windows Azure Caching Work in Compute Emulator,我必须添加一些信息:
我没有安装Windows Server AppFabric,所以我要去了!
答案 0 :(得分:0)
经过几天的调查,我设法解决了这个问题并成功创建了DataCacheFactory和DataCache的实例,依此类推。该问题在以下 2个帖子:
中进行了描述和解决http://blog.elastacloud.com/2012/06/09/using-the-windows-azure-cache-preview-with-sdk-1-7/
我想指出,Windows事件查看器帮助了很多。在Windows Azure日志中,我发现在使用Azure模拟器启动Web角色时发生的错误。 CacheInstaller.exe引发错误 - &gt; MissingMethodExceprion,带有消息:
找不到方法: “Microsoft.ApplicationServer.Caching.ClusterConfigElement