2

So, I'm using CloudFX with SDK 2.0 of Azure. Everything went well when I run my worker role outside Azure environment(neither cloud or emulator) in a console App.

When I'm trying to on Emulator or Cloud, I got an AggregateException with this info:

{"The type initializer for 'Microsoft.Experience.CloudFx.Framework.Diagnostics.TraceManager' threw an exception."}
Could not load file or assembly 'Microsoft.WindowsAzure.Diagnostics, Version=1.8.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)
   at Microsoft.Experience.CloudFx.Framework.Diagnostics.HybridTraceEventProvider..ctor(String providerName, Guid providerGuid)
   at Microsoft.Experience.CloudFx.Framework.Diagnostics.TraceManager.<>c__DisplayClass1.<Create>b__0(Guid guid)
   at System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key, Func`2 valueFactory)
   at Microsoft.Experience.CloudFx.Framework.Diagnostics.TraceManager.Create(String providerName, Guid providerGuid)
   at Microsoft.Experience.CloudFx.Framework.Diagnostics.TraceManager..cctor()

So I've tried to make this assembly redirect without success:

<dependentAssembly>
      <assemblyIdentity name="Microsoft.WindowsAzure.Diagnostics" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>

Seems that CloudFX still bounded/references SDK 1.8. Can anyone please help us with this problem?

Thanks!

Gutemberg Ribeiro
  • 1,533
  • 1
  • 21
  • 45

1 Answers1

1

With some help of a MSFT guy, Valery, I was able to fix this problem by double checking my configs making sure that nothing is pointing to version 1.8.0.0 and I have the assemblyBinding redirect config added.

While we dont have the new version of CloudFX release with the support to Azure SDK 2.0, all you need to do is add manually in the config this redirect at runtime/assemblyBinding/ section:

<dependentAssembly>
      <assemblyIdentity name="Microsoft.WindowsAzure.Diagnostics" publicKeyToken="31bf3856ad364e35" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-2.0.0.0" newVersion="2.0.0.0" />
    </dependentAssembly>

And that Azure-specific trace listener called AzureDiagnostics explicitly pointing to Microsoft.WindowsAzure.Diagnostics version=2.0.0.0

With it you should be able to use CloudFX with Azure SDK 2.0.

Gutemberg Ribeiro
  • 1,533
  • 1
  • 21
  • 45
  • 2
    Thank you so much! VS2013 users with the current Azure SDK 2.2 take note, you can use the following redirects to run CloudFX with the latest binaries from NuGet (as of Dec. 9, 2013); note that NuGet _should_ automatically update these when you update the packages **(except for Diagnostics, since it's not part of a package)**: `Microsoft.WindowsAzure.Storage` -> `3.0.0.0`, `Microsoft.WindowsAzure.Diagnostics` -> `2.2.0.0`, `Microsoft.ServiceBus` -> `2.2.0.0`, `System.Reactive.{Interfaces,Linq,Core,PlatformServices}` (need all four) -> `2.2.0.0`, `Microsoft.Data.OData` -> `5.6.0.0`. – Lars Kemmann Dec 10 '13 at 03:59