AppFabric Caching(Velocity) Gotchas So They Don't Get You

While playing with the new AppFabric Caching Beta 1 formally Velocity, I experienced a couple of things that might save you some time. First of all, I am extremely impressed with the concept of what AppFabric caching brings to the table. The concept of caching data and scaling it across multiple machines is powerful concept. Especially when you look at large amounts of data with high traffic or extreme processing. The cool thing with AFC is that everything can be driven though PowerShell commands. This is particularly important when you start thinking of the possibilities of driving caches through new tools like WF4 and the new capabilities it has with PowerShell. This caching model potentially brings a whole new methodology of how we build solutions geared for performance. So let's look at a couple of things that should save you time if you are running into the same issue or plan in the future of playing with the bits. First I will give you a kick start on how to get things started!

Once you get AppFabric Caching installed, the cachehost needs to be started. Below demonstrates the PS commands for viewing that status of the host(s)

Get-cachehost command shows me one host service and notice that it is down by default. I can start it by using the Start-cachehost and specifying a HostName and CachePort. Notice that the Service Status is now UP. Now that your service is up and CacheBaseLibrary.dll and ClientLibrary.dll are referenced and you have your code for pushing/getting from the cache you might run into the same error below upon compiling your solution.

This one had me going around in circles for awhile. First I thought that I had the wrong .Net 4 Framework and after going through my advanced checklist of wasting time, I checked the framework that my project defaulted to and noticed it was pointing to .Net Framework 4 Client Profile which was bad. You want to make sure it is compiling against good ol' .Net Framework 4.

So I am compiling now and ready to cache data. I run my code and get the strangest message I think I have ever received from Microsoft. But not any stranger than I have experienced from other applicationsMoney mouth


If you did not see the PDC09 video, or you did but really did not pay attention to what was being said about the security capabilities, this one sneaks up on you. You need to grant the user permission to hit the cache. Again PS becomes your friend and if you type the command, get-cachehelp you get the following. The important commands for viewing account access are highlighted in yellow.


To set access you can call Grant-CacheAllowedClientAccount with the account name like below.


Hopefully this post becomes useful to you as you journey down Microsoft's vision for caching data. If nothing else maybe it can start you thinking of the many benefits AFC will be bringing to the table here in the near future.

Currently rated 5.0 by 3 people

  • Currently 5/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Posted by: BayerWhite
Posted on: 12/11/2009 at 2:16 AM
Actions: E-mail | Kick it! | DZone it! |
Post Information: Permalink | Comments (1) | Post RSSRSS comment feed


Comments are closed