0

Asp.net アプリケーションで AppFabric を動作させようとしています。C# コードを使用して構成を行うと、すべて正常に動作します。しかし、web.configから機能させるのに本当に苦労しています。web.configに次のものがある場合、

<section name="dataCacheClient"
            type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
        Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, 
        Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            />

 <dataCacheClient>
  <hosts>
    <host name="localhost" cachePort="22233" />
  </hosts>
</dataCacheClient>

その後、私のコードは例外をスローしませんが、デフォルトのキャッシュに入れても実際には何もキャッシュに入れられません.バイト数は0です.

web.configを次のように変更すると

<section name="dataCacheClients"
            type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
        Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, 
        Culture=neutral, PublicKeyToken=31bf3856ad364e35"
            />

「s」が付いた「dataCacheClients」であり、

 <dataCacheClients>
<dataCacheClient name="default">
  <hosts>
    <host name="localhost" cachePort="22233" />
  </hosts>
</dataCacheClient>

例外が発生しました

ErrorCode<ERRCA0021>:SubStatus<ES0001>:Server collection cannot be empty

誰かが私がここで欠けているものを指摘するのを助けることができます.

どうもありがとう!

4

1 に答える 1

1

最初の例は正しいです。パラメーターを追加するだけです: allowLocation="true" allowDefinition="Everywhere".

<section name="dataCacheClient"
         type="Microsoft.ApplicationServer.Caching.DataCacheClientSection,
               Microsoft.ApplicationServer.Caching.Core, Version=1.0.0.0, 
               Culture=neutral, PublicKeyToken=31bf3856ad364e35"
         allowLocation="true"
         allowDefinition="Everywhere"/>
于 2013-02-15T11:46:53.487 に答える