Semantic Bug LogToWindowsAzureTable Azure 2.2 SDK

Oct 25, 2013 at 7:31 PM
Edited Oct 25, 2013 at 7:58 PM
When creating a New ObservableEventListener() and creating LogToWindowsAzureTable("","","") with reference to the azure storage 2.1 I get the following error

An unhandled exception of type 'System.IO.FileLoadException' occurred in Microsoft.WindowsAzure.ServiceRuntime.dll

Additional information: Could not load file or assembly 'Microsoft.WindowsAzure.Storage, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference.

This is all in a Azure Worker Role:

Steps to reproduce.

Install VS 2013, Install Azure SDK 2.2, Create Cloud Service, Add Worker Role, Add Semantic Logging through Nuget to worker role, add listener:
    public override bool OnStart()
        ServicePointManager.DefaultConnectionLimit = 12;
        var eventTableName = ConfigurationManager.AppSettings["EventsTableName"];

        var listener = new ObservableEventListener();
        listener.LogToWindowsAzureTable("WorkerEvents", @"UseDevelopmentStorage=true",
                                      eventTableName, TimeSpan.FromSeconds(10));
        listener.EnableEvents(WorkerLogs.Log, EventLevel.Verbose, Keywords.All);


        return base.OnStart();
Oct 28, 2013 at 3:25 AM
Edited Oct 28, 2013 at 4:40 AM
I think a binding redirect should help. Try adding this to the configuration:
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
        <assemblyIdentity name="Microsoft.WindowsAzure.Storage"
                          culture="neutral" />
        <bindingRedirect oldVersion=""
Randy Levy
Enterprise Library support engineer
Support How-to
Nov 4, 2013 at 7:45 PM
i'll give that a try, but seems like a hack rather than a fix, no?