How to: Prepare the Development Environment (Velocity)

05/24/2009

Preparing Your Project for "Velocity"
The assemblies required for developing cache-enabled applications are located in the "Velocity" installation folder. To develop applications that use these assemblies, the following three steps must be performed to prepare your development environment:

Copy the assemblies to your development workstation.

Set references to the assemblies in your Visual Studio project.

Configure the cache client by using an XML-based application configuration file, or programmatically with code.

To copy assemblies
Copy the assemblies to the development workstation from the installation folder of the cache server. This location was selected during installation of the "Velocity" cache host service.

Copy the following assemblies from the cache server to the same folder on the development workstation: CacheBaseLibrary.dll, ClientLibrary.dll, FabricCommon.dll, and CASBase.dll.

Note 
It is important that your application or development environment uses the same assemblies as the cache servers. During any upgrade of the distributed cache system, make sure that all cache clients using that system have the same versions of assemblies. Check this by comparing the Product version of the cache client's ClientLibrary.dll file with the Product version of the cache server's ServiceLibrary.dll file that is located in the installation folder.

Once the assemblies have been copied to the same folder in your development workstation, set references to them by following these steps.

To set references
After creating a new project in Visual Studio, from the Solution Explorer, right-click References and then select Add Reference.

Select the Browse tab, and then locate the copies of the assemblies from step 1 and select CacheBaseLibrary.dll and ClientLibrary.dll. To select more than one file, hold down Ctrl as you select them with the mouse. When all the files have been selected, click OK. This adds Microsoft.Data.Caching assemblies to the reference list for your application.

(optional) Add the using statement (Imports in Visual Basic) at the top of the code file to reference the Microsoft.Data.Caching namespace. This prevents having to add the "Microsoft.Data.Caching" prefix to each "Velocity" class when you program cache operations.

In order for the "Velocity" assemblies to communicate with the cache cluster, the cache client must be configured to run as either a simple client or a routing client.

To configure the cache client
Decide whether you want a routing or simple client. For best performance, use a routing client if your application (and development workstation) will have network connectivity to all cache hosts in the cluster. For more about the cache client types, see Cache Clients and Local Cache (Velocity).

Configure your cache client by using an application configuration file or programmatically. For examples about how to do this, see How to: Get Started with a Routing Client (XML) (Velocity) and How to: Get Started with a Routing Client (Code) (Velocity).

Posted in: Software Programming C# and .NET| Tags: Velocity CTP CTP 3 .NET 4.0 Microsoft

Hot Posts

Latest posts

Tags

Others

Sponsors

asp.net interview questions