StorageClient 1.1 is incorrectly referenced by AsAzureStorageClientRetryPolicy

Topics: Windows Azure Integration Pack
Jun 21, 2012 at 2:36 AM

I recently tried integrating the TransientFaultHandling project from NuGet into my Azure solution. When I call in my code AsAzureStorageClientRetryPolicy, I get a FileNotFoundException indicating it cannot find Microsoft.WindowsAzure.StorageClient v1.1. I tried a Runtime binding redirect to 1.7 but that still did not work. 

 

Is this a known issue?

Jul 22, 2012 at 9:28 AM

Hey,

I am having similar problem with the Auto scaling. did you manage to solve your problem?

I have installed the Auto scaling using NuGet. and when I try to run the Worker Role I get the following error:

{"Could not load file or assembly 'Microsoft.WindowsAzure.StorageClient, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"Microsoft.WindowsAzure.StorageClient, Version=1.1.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

on this line:

this.autoscaler = EnterpriseLibraryContainer.Current.GetInstance<Autoscaler>();

I have Azure SDK V1.7

Any help will be highly appreciated.

Thanks,
Yaniv.

Jul 24, 2012 at 3:27 AM

Enterprise Library 5.0 Integration Pack for Windows Azure is dependent on Windows Azure Tools for Visual Studio and Windows Azure SDK v1.6.  

One solution would be to install v1.6.  The issue, as the error message says, is that the Azure application blocks reference Microsoft.WindowsAzure.StorageClient version 1.1.0.0 (this is the version associated with Azure SDK v1.6) but Azure SDK v1.7 has a new version v1.7.  In a new project the Microsoft.WindowsAzure.StorageClient.dll should be automatically added in the <solution folder>\packages\WindowsAzure.Storage.1.7.0.0\lib\net35-full\ directory.

Installing and referencing v1.6 is probably not very forward looking so, provided that the assembly has been installed on your local machine, a binding redirect should be sufficient to resolve the issue.  I was able to recreate the problem and then resolve it using the following binding redirect:

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.WindowsAzure.StorageClient"
                          publicKeyToken="31bf3856ad364e35"
                          culture="neutral" />
        <bindingRedirect oldVersion="1.1.0.0"
                         newVersion="1.7.0.0"/>
      </dependentAssembly>
    </assemblyBinding>
  </runtime>

--
Randy Levy
Enterprise Library support engineer
entlib.support@live.com 

Marked as answer by randylevy on 10/7/2013 at 11:05 PM
Jul 24, 2012 at 6:03 PM

Hey Randy,

Thanks a lot for the solution. I figured it out last night at 2:00 AM :)

But indeed I can confirm your solution works.

 

Thanks again,

Yaniv.

Aug 13, 2013 at 7:12 PM
I try the bindingRedirect but that break VS code analysis thats still complaining about the old dependency.
Aug 13, 2013 at 7:22 PM
Assembly Binding Redirection and Code Analysis should help.

Basically, set StrongNameIgnoringVersion either on FxCopCmd.exe command line or in Visual Studio project file.

~~
Randy Levy
entlib.support@live.com
Enterprise Library support engineer
Support How-to
Marked as answer by randylevy on 10/7/2013 at 11:05 PM
Aug 13, 2013 at 8:38 PM
Thanks, that solved the problem