当我调用call factory.GetDefaultCache()...
时出现以下错误ErrorCode:SubStatus:引用的缓存不存在。请与管理员联系或使用缓存管理工具创建缓存。
请帮助..谢谢..
这是我的简单应用程序:
var config = new Microsoft.ApplicationServer.Caching.DataCacheFactoryConfiguration();
var servers = new List<Microsoft.ApplicationServer.Caching.DataCacheServerEndpoint>();
servers.Add(new Microsoft.ApplicationServer.Caching.DataCacheServerEndpoint("mymachine123", 22233));
config.Servers = servers;
var factory = new Microsoft.ApplicationServer.Caching.DataCacheFactory(config);
////var factory = _cacheFactory;
var cache = factory.GetDefaultCache(); <---- *** Error happens here..***
var key = "mykey";
var obj = cache[key];
if (obj == null)
{
cache[key] = "I am data for caching";
}
obj = cache[key];
Console.WriteLine(obj);
当我运行命令:start-cachecluster时,我得到以下内容:
HostName:CachePort服务名称服务状态版本信息 -------------------- ------------ -------------- ---- -------- mymachine123:22233 AppFabricCachingService UP 1 [1,1] [1,1]
答案 0 :(得分:2)
我自己设置了这个...它可能是一个权限问题。通过Grant-CacheAllowedClientAccount <youraccountname>