SharePoint serendipity is the effect by which one accidentally discovers something fortunate, especially while looking for something else entirely. In this case, it is the occassional musings, observations, and Ouija board readings about the phabulously

Server Collection Cannot Be Empty Error When Using Azure AppFabric Caching in Winforms Application

Server Collection Cannot Be Empty Error When Using Azure AppFabric Caching in Winforms Application

  • Comments 3
  • Likes

I had a problem that unfortunately I've seen a few people run across when using the AppFabric caching feature of Windows Azure.  This is the release version of the caching mechanism formerly known as Velocity.  When you have a problem with the caching factory that it uses, most frequently the error message you will see thrown is along the lines of "server collection cannot be empty".  Unfortunately that is another ubiquitous error that is frequently fairly difficult to track down.  In this case it was even more perplexing - I had a compiled standalone assembly that was making use of the cache.  When I called that assembly from an Azure worker role I wasn't getting any errors at all.  However, when I added a reference to the assembly to my winforms test application and tried running it, I got the dreaded error.

After a fair amount of poking around, de-hairing my head one strand at a time, and soul searching (why am I here, why do I work on this stuff), it finally hit me what the problem was.  Even though my winform app was not directly invoking the caching classes, it was the host process.  All that means is that all of the cache configuration entries that were in my worker role application, had to be added to the app.config of my winforms application.  Once I added them in everything worked fine.

This type of scenario is somewhat common I suppose, but since this error is such a pain to track down I thought I would capture here for folks caught in a similar predicament.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment