|
Register NCache with EntLib 5.0 CAB using Configuration Console
Following are the steps to register NCache as Custom Cache Manager:
-
Include Enterprise Librarys Caching.dll, Common.dll, ObjectBuilder2.dll, Unity.dll and Alachisoft's CacheManager.dll references to project.
-
Add new Caching Application Block through Enterprise Library Configuration Console.
-
Add a new Custom Cache Manager.
-
Select NCache CacheManager assembly as a Custom Cache Manager Provider type. You can also specify Custom Cache Manager's name here as shown in the figure.
You can find "Alachisoft.NCache.EnterpriseLibrary.Caching.CacheManager.dll" file at "%InstallDir%/NCache/bin/assembly/clr20".
-
Add a key CacheId, and a cache id as value that acts as your primary cache under enterprise library's Caching Application Block.
-
Add a key CacheExceptions, and its value (true/false) for enabling caching exceptions thrown to client application
-
Assign Default Cache Manager value to be the cache manager you just have created.
-
Save the configurations as App.config in your project folder and add it in your project.
-
Your sample configuration, dealing with NCache as a custom cache manager would look like this.
Note: Your object must be tagged as serializable while using NCache as your primary store.
See Also
|
|