运行简单的Windows Server App Fabric 1.0演示控制台应用程序时出现以下错误:
ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty.
请帮帮我..我错过了什么..?? 我已经查看了互联网上的每个地方,似乎没有任何东西可以解决这个问题。谢谢..
我的申请如下:
static void Main(string[] args)
{
var factory = new Microsoft.ApplicationServer.Caching.DataCacheFactory(); <--- *** Error here
var cache = factory.GetDefaultCache();
var key = "mykey";
var obj = cache[key];
if (obj == null)
{
cache[key] = "I am data for caching";
}
obj = cache[key];
Console.WriteLine(obj);
Console.Read();
}
我的 app.config 如下:
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="dataCacheClients"
type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core" />
</configSections>
<dataCacheClients>
<dataCacheClient>
<hosts>
<host name="MyMachineNameHere" cachePort="22233" />
</hosts>
</dataCacheClient>
</dataCacheClients>
</configuration>