2013-06-04 88 views
0

當我使用多個dataCacheClients時出現此錯誤。我見過this questionthis msdn question,但在AppFabric 1.0時,多個dataCacheClients是不可能的。 Microsoft在AppFabric 1.1中添加了此功能(請參閱changelog),我目前正在使用該功能。任何想法,爲什麼我得到這個錯誤?下面是我的配置文件:服務器集合不能爲空 - Windows Server AppFabric 1.1

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

注:

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

更多的錯誤信息發現:

enter image description here

回答

1

我終於能夠得到它的工作。我犯了一些基本但愚蠢的錯誤。希望有同樣問題的人可以通過我的回答得到一些指導。所犯下的錯誤我犯了/它是如何糾正:


1)檢查DLL的CLR版本

往常一樣,我的意思是,您使用的是指動態鏈接庫的總檢查版本在你的消費客戶端。看出來的DLL是:

  • Microsoft.ApplicationServer.Caching.Core.dll

  • Microsoft.ApplicationServer.Caching.Client.dll

  • Microsoft.WindowsFabric.Common.dll

  • Microsoft.WindowsFabric.Data.Common.dll

  • Microsoft.Web.Distrib utedCache(這是什麼原因導致我的問題 - 我的解決方案中添加了舊版本;有沒有必要提到這一點,只是有在同一文件夾這個DLL爲Caching.CoreCaching.Client就夠了)

好(或者說防故障)的方式來獲得最新的DLL就是download & install Appfabric並獲得從.\Program Files\AppFabric 1.1的DLL,將其添加到內的文件夾並將其引用。


2)DataCacheFactory必須有什麼dataCacheClient其指

就像如何AppFabricCacheSessionStoreProvider必須包含dataCacheClientName屬性是指一個特定的集羣投入dataCacheClientDataCacheFactory初始化代碼必須參考還包含對dataCacheClient的引用,其將要照顧caching

DataCacheFactory _factory = new DataCacheFactory(new DataCacheFactoryConfiguration("dataCacheClient1")) 

感謝大家幫助解決這個問題!

1

我在我們的一臺開發機器上遇到了這個問題,最終發現它是安裝Windows Server AppFabric。我的配置完全正確。在除了一臺機器之外的所有機器上都配置了相同的配置,並且一旦我們從該機器上卸載了Windows Server AppFabric並安裝了Microsoft AppFabric 1.1版本,問題就解決了。

我也使用AppFabric來存儲Asp.NET SessionState。

相關問題