The weird exception is thrown when calling ISession.Save and ICriteria.List with v1.0.2,
but not with v1.0.1. I'm using it with ASP.NET v2.0.50727 and already made my assembly strong-named and give full trust to this web app.
I looked at the source and found the problemic IdentityHashCodeProvider class is written in ILasm (?!)...
Following is the stack trace:
Code:
[VerificationException: Operation could destabilize the runtime.]
NHibernate.IdentityHashCodeProvider.System.Collections.IHashCodeProvider.GetHashCode(Object obj) +6
System.Collections.CompatibleComparer.GetHashCode(Object obj) +29
System.Collections.Hashtable.GetHash(Object key) +16
System.Collections.Hashtable.get_Item(Object key) +67
NHibernate.Util.SequencedHashMap.set_Item(Object o, Object value) +35
NHibernate.Impl.SessionImpl.AddUninitializedEntity(Key key, Object obj, LockMode lockMode) +112
NHibernate.Loader.Loader.LoadFromResultSet(IDataReader rs, Int32 i, Object obj, Key key, String suffix, LockMode lockMode, ILoadable rootPersister, ISessionImplementor session) +131
NHibernate.Loader.Loader.InstanceNotYetLoaded(IDataReader dr, Int32 i, ILoadable persister, String suffix, Key key, LockMode lockMode, Key optionalObjectKey, Object optionalObject, IList hydratedObjects, ISessionImplementor session) +159
NHibernate.Loader.Loader.GetRow(IDataReader rs, ILoadable[] persisters, String[] suffixes, Key[] keys, Object optionalObject, Key optionalObjectKey, LockMode[] lockModes, IList hydratedObjects, ISessionImplementor session) +326
NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, IList hydratedObjects, Object optionalObject, Object optionalId, Key[] keys, Boolean returnProxies) +363
NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +599
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies) +64
NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes) +219
NHibernate.Loader.CriteriaLoader.List(ISessionImplementor session) +614
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +351
[ADOException: Unable to perform find]
NHibernate.Impl.SessionImpl.Find(CriteriaImpl criteria) +399
NHibernate.Impl.CriteriaImpl.List() +13
AqDWeb.Infrastructure.VersionedEntityService`1.FindAll() in \\aqd\private\code\YaDiary\App_Code\AqDWeb.Infrastructure\VersionedEntityService.cs:40
YaDiary.Context.Pages.DemoPage.OnDataBinding(EventArgs e) in \\aqd\private\code\YaDiary\App_Code\YaDiary.Context.Pages\DemoPage.cs:22
AqDWeb.Infrastructure.ManagedPage.UpdateViewFromModel(Control control, IDictionary context) in \\aqd\private\code\YaDiary\App_Code\AqDWeb.Infrastructure\ManagedPage.cs:197
AqDWeb.Infrastructure.ManagedPage.OnPreRenderComplete(EventArgs e) in \\aqd\private\code\YaDiary\App_Code\AqDWeb.Infrastructure\ManagedPage.cs:140
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1566