Can't resolve dependency of Enyim.Caching

2.1k Views Asked by At

I have a problem with resolving dependency to Enyim.Caching.dll while using Couchbase client. I have downloaded the dlls via NuGet and referenced them in the project. The solution compiles fine with the downloaded assembly Enyim.Caching, Version=2.12.0.0, Culture=neutral, PublicKeyToken=05e9c6b5a9ec94c2. But in the runtime Couchbase throws an exception because it is looking for Enyim.Caching, Version=2.12.0.0, Culture=neutral, PublicKeyToken=cec98615db04012e.

I can't undestand why it requires another dll of the same version, but with another PublicKey.

I also tried the solution described in Cant get the couchbase .net memcache client to run, complains it's strong name validation failed to remove strongname requirements via using ns.exe. But it didn't workout.

Can anoyone help me?

2

There are 2 best solutions below

0
On

In the end I managed to solve this problem using description in the file Readme.mdown of couchbase-net-client project. They say that there are 2 ways to solve the problem: either remove the strong name checking via sn.exe or via removing assembly signing at all.

I have chosen the second way, since I don't that need assembly signing. I rebuilt the source from the scratch, removed every entry NuGet has created for me and manually added references to all assemblies. And it worked like a charm :)

0
On

you can delete node with "public_key.snk" in file "build/CommonProperties.targets"

<!-- delay sign the assembly if the PrivateKeyPath property is not specified -->
<!--<PropertyGroup Condition=" '$(PrivateKeyPath)' == '' And '$(PrivateKeyName)' == ''">
    <AssemblyOriginatorKeyFile>..\public_key.snk</AssemblyOriginatorKeyFile>
    <DelaySign>true</DelaySign>
</PropertyGroup> -->