Failed to load Microsoft.ApplicationServer.Caching.Core file or assembly.

I am trying to use Windows Azure Caching Preview .

I have one separate working cache role, one web role that uses the previous cache, and one working role that constantly updates the cache.

I followed the instructions in the Windows Azure manual , but I still get the error message:

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 manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

I use double triple 1,000,000 checked dependencies, there are correct ones. I noticed that there are two sets of dlls: those versions 1.0.0.0 that I want to use, and the other version 101.0.0.0 I do not want. I added the BindingRedirect instruction to all my .config files to display the 101 version up to 1.0.0.0 I checked the \ bin folder, decompiled the DLL with Jetbrains, they are correct. I'm starting to lose patience. Why doesn't .NET accept the DLL that I specify when I put the explicit path?

+6
source share
3 answers

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 .

That was enough for me.

Here is a more specific description of the problem: it seems to work fine for individual project execution: I have 3 worker roles and one web role. Each time I build a project one by one, I see the correct dll in the output directory, I only have a problem with the Windows Azure Cloud package, it seems to ignore the BindingRedirect directive.

+2
source

Just keep the offer in an appropriate place.

I ran into the problem described in questiuon, the only difference being that it could not find Caching.Client instead of Caching.Core. I tried to delete the libraries in the SDK ref folder, as suggested in the previous answer, but this did not help.

Anyway, my solution seems rather special.

What helped me was 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

For some reason, they were skipped in the packages.config file, so they could not be updated from the nuget feed. Therefore, you can try to reference them directly or in another way to make them available to the project that you are trying to run.

+1
source

AppFabric is not configured to register its own DLLs after installation.

You need 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 
+1
source

Source: https://habr.com/ru/post/922833/


All Articles