I'm trying to wire up NHibernate to use the Enyim.Memcached provider for its second-level caching. Additionally, I want Enyim.Memcached to use the protobuf-net as its serializer.
Looking at nuget and the web, I can find pretty much all the pieces I need:
nuget:
protobuf-net.Enyim
protobuf-net
(dependency of protobuf-net.Enyim)EnyimMemcached (Enyim.Caching)
v2.12 (dependency of protobuf-net.Enyim)
web: (http://sourceforge.net/projects/nhcontrib/files/NHibernate.Caches/ -- I couldn't find a nuget package for NHibernate.Caches.EnyimMemcached)
NHibernate.Caches.EnyimMemcached
Enyim.Caching
v2.3
However, when I wire everything up, I get a The located assembly's manifest definition does not match the assembly reference.
error. The issue appears to be:
NHibernate.Caches.EnyimMemcached
wantsEnyim.Caching
v2.3protobuf-net.Enyim
wantsEnyim.Caching
v2.12
They don't play nice. I tried adding an assembly redirect, but to no avail:
<dependentAssembly>
<assemblyIdentity name="Enyim.Caching" publicKeyToken="cec98615db04012e" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-2.3.0.0" newVersion="2.3.0.0" />
</dependentAssembly>
The "latest" Enyim.Caching assembly (via the EnyimMemcached package) only has v2.12. D'oh! 2.12 is more recent than 2.3. (Thanks for pointing that out Marc!)
Any thoughts? Is there a NHibernate.Caches.EnyimMemcached nuget package I don't know about? Or a protobuf-net.Enyim that uses 2.3 instead of 2.12? I can't imagine I'm the only one that has tried to use this NHibernate-Enyim-Protobuf-net stack. And I'm surprised the assembly binding redirect didn't fix the issue.
UPDATE: I'm good to go after following Marc's advice. I simply downloaded the source of NHibernate.Caches.EnyimMemcached and changed its Enyim.Caching reference from the unsigned v2.3 assembly to the signed 2.12 assembly. Everything's gravy!