Step 2: Using MS Velocity Wrapper API
To enable your existing velocity based app to use NCache, you need to make slight changes in your application. These changes are minimal and not a true code change, rather re-referencing your application to use NCache's Wrapper namespace. NCache supports regions in a different way.
-
Remove reference to using System.Data.Caching; from your code file.
-
Add reference to VelocityWrapper assembly named Alachisoft.NCache.Data.Caching.dll placed at %InstallDir%/NCache/bin/assembly/
-
Add reference to Alachisoft.NCache.Web.dll, present in GAC.
-
Add the following namespaces:
using Alachisoft.NCache.Data.Caching;
using Alachisoft.NCache.Web.Caching;
-
Give fully qualified name of Cache to resolve ambiguity between Alachisoft.NCache.Web.Caching.Cache vs Alachisoft.NCache.Data.Caching.Cache classes.
Note:
See Also