find a location for property in a new city

Monday, 12 September 2011

Azure TableServiceContext does not contain CreateQuery Azure

I have done it loads of times before but this time when trying to call CreateQuery, Add Object, DeleteObject, UpdateObject or SaveChanges on my TableServiceContext I got an error saying "'Microsoft.WindowsAzure.StorageClient.TableStorageServiceContext' does not contain a definition for 'CreateQuery'".

I keep forgetting that as well as including the Microsoft.WindowsAzure.StorageClient assembly I also need to include System.Data.Services.Client.

This is because, although TableStorageServiceContext comes in Microsoft.WindowsAzure.StorageClient.dll, it inherits from DataServiceContext which is part of another assembly, System.Data.Services.Client.dll. So this must be included in you Azure storage project.

Follow britishdev on Twitter

5 comments:

  1. Nice buddy.. You saved my time

    ReplyDelete
  2. good one. You saved my life.

    ReplyDelete
  3. You also saved me loads of headache. Thanks for this :)

    ReplyDelete
  4. Brilliant mate!

    ReplyDelete
  5. Thanks mate.. you may not have saved my life, but definitely a few grey hairs!

    ReplyDelete