I'm using NHibernate 2.1.2
via Castl ActiveRecord. I wanted to set up second level cache using SysCache
. But I got error:
Unable to cast object of type 'NHibernate.Caches.SysCache.SysCacheProvider' to type 'NHibernate.Cache.ICacheProvider'.
How can I correct this?
I found the reason. It was a nasty problem from ours. My team have merged all Castle ActiveRecord related assemblies together with
ilmerge.exe
and suppose named itCompany.NHibernate.dll
. I have not mergedNHibernate.Caches.SysCache.dll
withCompany.NHibernate.dll
. I have just putNHibernate.Caches.SysCache.dll
alongside ofCompany.NHibernate.dll
and mentioned name ofNHibernate.Caches.SysCache
inprovider_class
.When I merged
NHibernate.Caches.SysCache.dll
withCompany.NHibernate.dll
and mentioned name ofCompany.NHibernate.dll
inprovider_class
instead, everything went OK.Thanks all users that tried to help me.