Microsoft Windows Server AppFabric Cookbook
上QQ阅读APP看书,第一时间看更新

Installing Cache Client Assemblies

For non-production/client environments, we do not need to install the complete Windows Server AppFabric. Instead, we can use Client Assemblies to connect to an instance of AppFabric. In this recipe, we will see how to set up a Client Machine that can connect to and communicate with Windows Server AppFabric. Once we have set up the Client Assemblies, then we can use Visual Studio, for example, to write applications that can use Windows Server AppFabric Caching capabilities.

Note

Cache Client, as the name implies, refers to the applications or services that can access and modify cached items by connecting to a configured or specified cache cluster.

Getting ready

To set up the Cache Client, you will need the following assemblies:

  • Microsoft.ApplicationServer.Caching.Core.dll
  • Microsoft.ApplicationServer.Caching.Client.dll
  • Microsoft.WindowsFabric.Common.dll
  • Microsoft.WindowsFabric.Data.Common.dll

Note

For the Windows Server AppFabric Caching Client to be able connect to the Windows Server AppFabric Caching Service, it is required that Client Binaries are of the same version number as that of the Cache Service.

How to do it...

Setting up the Client Caching environment is a very simple task; it is just a matter of copying the binaries highlighted at the start of the recipe to a particular location. These binaries can be obtained by installing Windows Server AppFabric on a workstation. You will need the Caching feature installation to get the required Caching binaries. The default location for these assemblies is .\Windows\System32\AppFabric:

  1. On Windows 7, type C:\Windows\System32\AppFabric in the custom menu; you should be able to see a number of binaries and the configuration file:
    How to do it...
  2. Obtain the following assemblies from the Windows Server AppFabric Cache installation:
    • Microsoft.ApplicationServer.Caching.Core.dll
    • Microsoft.ApplicationServer.Caching.Client.dll
    • Microsoft.WindowsFabric.Common.dll
    • Microsoft.WindowsFabric.Data.Common.dll
  3. Copy the assemblies mentioned in step 2 to a place where they are available under a known path to your Client application.

Note

To cache-enable an application server, you will need to install the Windows Server AppFabric Caching Assemblies on it. It is as simple as having an application/service installed on the server along with the AppFabric Caching assemblies. As long as your application installation copies the AppFabric Cache Assemblies and has a valid configuration in place, your application server is Cache enabled.

How it works...

The Windows Server AppFabric Caching Client application requires an API to talk to the Caching Service. This API (provided as a set of assemblies highlighted earlier in this recipe) must be available for the client to program against it. By copying these assemblies on the client machine, we ensure that the client does not need to do a complete installation of Windows Server AppFabric.

Once the Client Assemblies are available, we can write applications that can use AppFabric's Caching capabilities and connect to the AppFabric Caching cluster.