2012-04-26

AppFabric for Windows Server 1.1 - Powershell is not working after upgrade from 1.0

After the installation of AppFabric for Windows Server 1.1, the Powershell to manage the cache cluster was not working anymore.

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!