The bug - Could not load file or assembly Microsoft.ApplicationServer.Caching.SqlProvider
Use-CacheCluster : ErrorCode:SubStatus :Provider "System.Data.SqlClient" instantiation failed: Could not load file or assembly 'Microsoft.ApplicationServer.Caching.SqlProvider, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find th e file specified. At line:1 char:62 + Import-Module DistributedCacheAdministration;Use-CacheCluster <<<< + CategoryInfo : NotSpecified: (:) [Use-CacheCluster], DataCacheException + FullyQualifiedErrorId : ERRCMS0007,Microsoft.ApplicationServer.Caching.Commands.UseCacheClusterCommand
The resolution
After a couple of hours searching on the internet, I found nothing to resolve the problem... so I tried to hacked myself. I found the solution! There is a missing DDL in the DistributedCacheAdministration Powershell module. I've simply added the missing DLL in the configuration file (C:\Program Files\AppFabric 1.1 for Windows Server\PowershellModules\DistributedCacheAdministration\DistributedCacheAdministration.psd1) of the module :@{ ModuleVersion = '1.0' GUID = 'e0f1ac07-c706-4b65-ac0b-63ac0ab31237' Author = 'Microsoft Corporation' CompanyName = 'Microsoft Corporation' Copyright = '(c) Microsoft Corporation. All rights reserved.' Description = 'Microsoft AppFabric Caching Administration module' PowerShellVersion = '2.0' RequiredAssemblies="..\..\Microsoft.ApplicationServer.Caching.SqlProvider.dll", "..\..\Microsoft.ApplicationServer.Caching.Management.dll", "..\..\Microsoft.ApplicationServer.Caching.Server.dll", "..\..\Microsoft.ApplicationServer.Caching.Core.dll", "..\..\Microsoft.WindowsFabric.Common.dll", "..\..\Microsoft.WindowsFabric.Data.dll", "..\..\Microsoft.WindowsFabric.Data.Common.dll", "..\..\Microsoft.WindowsFabric.Federation.dll" TypesToProcess = @() FormatsToProcess = 'Microsoft.ApplicationServer.Caching.ManagementPS.format.ps1xml' NestedModules = 'Microsoft.ApplicationServer.Caching.ManagementPS' CmdletsToExport = '*' }
Good luck with your future evil AppFabric configuration problem!
Excellent tips! Thanks a lot!
ReplyDeleteThis why App Fabric for caching sucks big ones. Redis just works anywhere. I am in versioning hell at the moment and its all fixable by copying all the Microsoft.WindowsFabric.* dll's to the bin folder of a web app...
ReplyDeleteSuch a waste of time with a ridiculous issue.
Well, once it's setup correctly it's working great. I'm currently using it in Azure Cloud Service, and there's no more installation/maintenance nightmare when we use the Shared Caching. You can simply setup a percentage of memory allowed for AppFabric and they do all the configuration part. If you have the chance to switch to Azure go for it.
DeleteFor an application hosted on-premise, I would probably use another distributed cache engine.
Great! Also solved my problem!
ReplyDeleteTy. SK.
Informative article it's really. A friend of mine has long been awaiting just for this content. I really like your writing so a lot!
ReplyDeleteThe best and the #1 Funeral homes website design, Build by OptiMized360.