私はこの方法を(方法、方法)必要以上に複雑にしていたようです。
Unity および Instrumentation を使用せずにアプリケーション ブロック キャッシングを実装する手順。
構成ファイルに次を追加します。
<section name="cachingConfiguration" type="Microsoft.Practices.EnterpriseLibrary.Caching.Configuration.CacheManagerSettings, Microsoft.Practices.EnterpriseLibrary.Caching" requirePermission="true" />
...
<cachingConfiguration defaultCacheManager="Default">
<cacheManagers>
<add name="Default" expirationPollFrequencyInSeconds="60" maximumElementsInCacheBeforeScavenging="10000" numberToRemoveWhenScavenging="100" backingStoreName="NullBackingStore" type="Microsoft.Practices.EnterpriseLibrary.Caching.CacheManager, Microsoft.Practices.EnterpriseLibrary.Caching" />
</cacheManagers>
<backingStores>
<add type="Microsoft.Practices.EnterpriseLibrary.Caching.BackingStoreImplementations.NullBackingStore, Microsoft.Practices.EnterpriseLibrary.Caching" name="NullBackingStore" />
</backingStores>
</cachingConfiguration>
キャッシュ宣言が必要な場所:
ICacheManager _cache = CacheFactory.GetCachemanager();
その後、キャッシュ ブロックの幅と奥行きをすべて使用できます。