服务器集合不能为空 - Windows Server AppFabric 1.1

时间:2013-06-04 03:39:48

标签: appfabric windows-server appfabric-cache

当我使用多个dataCacheClients时,我收到此错误。我见过this questionthis msdn question,但在AppFabric 1.0时,多个dataCacheClients是不可能的。 Microsoft在AppFabric 1.1中添加了此功能(请参阅changelog),我目前正在使用它。关于我为何会收到此错误的任何想法?这是我的配置文件:

<configuration>
<configSections>

 <section name="dataCacheClients"
         type="Microsoft.ApplicationServer.Caching.DataCacheClientsSection, Microsoft.ApplicationServer.Caching.Core"
         allowLocation="true" 
         allowDefinition="Everywhere"/>
</configSections>

<dataCacheClients>
<!--client 1 for caching-->
<dataCacheClient name="dataCacheClient1">
  <localCache isEnabled="false" sync="NotificationBased" objectCount="100000"/>
  <clientNotification pollInterval="5"/>
  <hosts>
    <host name="!2345623ghf1.fg.com" cachePort="22233"/>
  </hosts>
  <securityProperties mode="None" protectionLevel="None" />
  <transportProperties maxBufferPoolSize="2147483647" maxBufferSize="2147483647" channelInitializationTimeout="60000" receiveTimeout="900000"/>
</dataCacheClient>
<!-- client 2 for session -->
<dataCacheClient name="dataCacheClient2">
  <localCache isEnabled="false" sync="NotificationBased" objectCount="100000"/>
  <clientNotification pollInterval="5"/>
  <hosts>
    <host name="!2345623ghf2.fg.com" cachePort="22233"/>
  </hosts>
  <securityProperties mode="None" protectionLevel="None" />
  <transportProperties maxBufferPoolSize="2147483647" maxBufferSize="2147483647" channelInitializationTimeout="60000" receiveTimeout="900000"/>
</dataCacheClient>


</dataCacheClients>


<system.web>
<compilation debug="true" targetFramework="4.0">
</compilation>

<sessionState
  mode="Custom"
  customProvider="AppFabricCacheSessionStoreProvider">
  <providers>
    <add name="AppFabricCacheSessionStoreProvider"
         type="Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider, Microsoft.Web.DistributedCache"
         cacheName="default"
         dataCacheClientName="dataCacheClient2" />
  </providers>
</sessionState>

注意:

我正在使用.\Program Files\AppFabric 1.1 for Windows Server

中的DLL

更多错误详情:

enter image description here

2 个答案:

答案 0 :(得分:1)

我终于能够让它运转起来了。我犯了一些基本的但是愚蠢的错误。希望有相同问题的人能够通过我的回答得到一些指导。我犯的错误/如何纠正:


1)检查DLL的CLR版本

总是,我的意思是,总是检查您在消费客户端中引用的DLL的版本。要注意的DLL是:

  • Microsoft.ApplicationServer.Caching.Core.dll

  • Microsoft.ApplicationServer.Caching.Client.dll

  • Microsoft.WindowsFabric.Common.dll

  • Microsoft.WindowsFabric.Data.Common.dll

  • Microsoft.Web.DistributedCache(这是导致我出现问题的原因 - 我在我的解决方案中添加了旧版本;没有必要引用它,只需将此DLL放在与{{1相同的文件夹中和Caching.Core就够了)

获取最新DLL的一种好的(或者说是防错的)方法是download & install Appfabric并从Caching.Client获取DLL,将其添加到里面的文件夹中项目并从那里参考。


2).\Program Files\AppFabric 1.1必须引用其引用的DataCacheFactory

就像dataCacheClient必须包含AppFabricCacheSessionStoreProvider属性以引用放入dataCacheClientName的特定群集一样,dataCacheClient init中的代码还必须包含对{的引用{1}}这将照顾DataCacheFactory

dataCacheClient

感谢所有帮助解决此问题的人!

答案 1 :(得分:1)

我在其中一台开发机器上遇到此问题,最终发现是Windows Server AppFabric的安装。我的配置完全正确。相同的配置适用于除一台机器之外的所有机器,一旦我们从该机器上卸载了Windows Server AppFabric并安装了Microsoft AppFabric 1.1版本,问题就解决了。

我也在使用AppFabric来存储Asp.NET SessionState。