6

I'm trying to use Windows Azure Caching Preview.

I have one dedicated cache worker role, One webrole that use the former cache, and one worker role that continuously update cache.

I followed the instructions on the Windows Azure guide but I still get an error :

Could not load file or assembly 'Microsoft.ApplicationServer.Caching.Core, Version=1.0.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)

I double triple 1000000 checked dependencies, there are correct. I noticed there were two sets of dlls : the ones version 1.0.0.0 I want to use, and another version 101.0.0.0 I don't want. I added BindingRedirect statement to all my .config files to map 101 versions to 1.0.0.0 I checked the \bin folder, decompiled the dlls with Jetbrains, they are correct. I begin to lose patience. Why doesn't .NET take the DLL I specify when I put the explicit path ?

Richard J. Ross III
  • 55,009
  • 24
  • 135
  • 201
Rodolphe Beck
  • 363
  • 1
  • 5
  • 14
  • Ok, the only wai I found to solve this issue : Search for all references of the dll on my hard drive and replace it with the correct copy. – Rodolphe Beck Aug 14 '12 at 14:57

3 Answers3

2

Ok I found another way : I just renamed C:\Program Files\Microsoft SDKs\Windows Azure.NET SDK\2012-06\ref\Microsoft.ApplicationServer.Caching.Core.dll to Microsoft.ApplicationServer.Caching.Core.dll_old.

It was enought for me.

Here is a more specific description of th issue : it seems to work perfectly when taking projects individually : I have 3 worker roles and one web role. Each time I build my project one by one, I see the correct dll in output directory, I only have a problem with Windows Azure Cloud package, it seems to ignore the BindingRedirect directive.

Rodolphe Beck
  • 363
  • 1
  • 5
  • 14
2

AppFabric isn't setup to register its own DLLs after install.

You have to manually register them. Run this in powershell to fix everything:

Set-location "C:\Program Files\AppFabric 1.1 for Windows Server"            
[System.Reflection.Assembly]::Load("System.EnterpriseServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")            
$publish = New-Object System.EnterpriseServices.Internal.Publish            
$publish.GacInstall("C:\Program Files\AppFabric 1.1 for Windows Server\Microsoft.ApplicationServer.Caching.Core.dll")
$publish.GacInstall("C:\Program Files\AppFabric 1.1 for Windows Server\Microsoft.ApplicationServer.Caching.Client.dll")
$publish.GacInstall("C:\Program Files\AppFabric 1.1 for Windows Server\Microsoft.WindowsFabric.Common.dll")
$publish.GacInstall("C:\Program Files\AppFabric 1.1 for Windows Server\Microsoft.WindowsFabric.Data.Common.dll")             
iisreset
Anonymous
  • 21
  • 1
1

Just a suggestion to store in relevant place.

I have encountered with the problem described in the questiuon, only difference is that it could not find Caching.Client instead of Caching.Core. I tried removing libraries in SDK ref folder, as suggested in previous answer, but it did not help.

Anyway, my solution seems to be rather particular.

What helped in my case is that I found some libraries that were not referenced, but they were found among packages in the only environment where my project worked. Here they are: * System.Web.Providers.1.1 * System.Web.Providers.Core.1.0

They were missed in packages.config file for some reason, so they could not be renewed from nuget feed. So you might try referencing them directly or other way to make them accessible to the project you're trying to run.

moudrick
  • 2,148
  • 1
  • 22
  • 34