Friday, May 11, 2012 12:44 PM
I want to deploy a SharePoint solution which makes use of appfabric caching. Therefore I added the two required references to Microsoft.ApplicationServer.Caching.Client.dll and Microsoft.ApplicationServer.Caching.Core.dll. So far so good.
This worked fine for my test console application. My sharepoint solutions however always threw exceptions at my face. Assembly missing... ok. So I went forth and had a look at the DLLs provided in the appfabric installation directory. There are two more assemblies my sharepoint solutions complained about:
- Microsoft.WindowsFabric.Common.dll and
And in fact... in the bin directory of my test console application there are copies of these two DLLs. So I added them to my sharepoint solution package and deployed them along to the GAC. Good. Solution working now. However I cannot run the Caching Administration PowerShell anymore! Neither do I get any statistics in perfmon.
Caching Administration PowerShell fails with the following error message:
Use-CacheCluster : ErrorCode<ERRCMS0007>:SubStatus<ES0001>:Provider "System.Data.SqlClient" instantiation failed: Could not load file or assembly 'Microsoft.ApplicationServer.Caching.SqlProvider, Version=220.127.116.11, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the 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 dll in question also lives in the appfabric installation directory. The assembly wears version number 1.0.4632.0 though (??). Anyway... as soon as I retract my SharePoint solution (...as soon as the appfabric dlls are removed from the GAC) both powershell and perfmon work again.
Of course I need both - my sharepoint solution and the powershell administration working! What's wrong about deploying appfabric caching dlls to the GAC?
- Edited by Venenum Friday, May 11, 2012 12:47 PM
Monday, May 14, 2012 4:57 AM
I think whats happening here is that when you GAC 1 DLL, it expects others loaded by it also to be in GAC.
You should be placing the DLLs your app uses in bin, or else GAC all cache libraries, there is an appfabric cache GAC installation, see if it solves the issue for you.
Monday, May 14, 2012 9:44 AM
I tried the automated /GAC install.
Some assemblies are in fact copied to the GAC... but only very few.
The ones I need (caching + Microsoft.WindowsFabric.Common.dll + Microsoft.WindowsFabric.Data.Common.dll) are not copied to the GAC.
Tuesday, May 15, 2012 4:32 AM
GAC all the dlls, or copy them to bin instead of GACing.
Client + Admin +Server on the same machine should be a development scenario and not production, in which case binning all the binaries should be ok.
The GAC scenario we support is as supported by /GAC install flag. Manual GACing if not complete will always run into issues as the components of the service are in different DLLs.
Tuesday, May 15, 2012 10:55 AM
1. Deploying Microsoft.ApplicationServer.Caching.Client.dll and Microsoft.ApplicationServer.Caching.Core.dll to the GAC is not a problem - deploying Microsoft.WindowsFabric.Common.dll and Microsoft.WindowsFabric.Data.Common.dll is! Unfortunately it just doesn't suffice to add the Caching.Client and Caching.Core dlls to the GAC... I'm wondering if it works if I uninstall AppFabric Caching (the server part) from my developer workstation.
2. To be able to deploy these dlls to the bin directory and actually use them I would have to lower my security settings or supply a proper CAS policy.