I've got a small problem, but I'm not sure whether it's a bug or behavior by design:
When I use <any> type mappings in a class to represent a relationship with any other type of class I get the following exception when trying to load a persisted class with an <any> reference after my framework has been recompiled:
Code:
FileLoadException
The located assembly's manifest definition with name 'Framework.Core' does not match the assembly reference.
at System.Type.GetType(String typeName, Boolean throwOnError)
at NHibernate.Util.ReflectHelper.ClassForName(String name)
at NHibernate.Type.TypeType.Get(IDataReader rs, Int32 index)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name)
at NHibernate.Type.NullableType.NullSafeGet(IDataReader rs, String name, ISessionImplementor session, Object owner)
at NHibernate.Type.ObjectType.Hydrate(IDataReader rs, String[] names, ISessionImplementor session, Object owner)
at NHibernate.Loader.Loader.Hydrate(IDataReader rs, Object id, Object obj, ILoadable persister, ISessionImplementor session, String[][] suffixedPropertyColumns)
at NHibernate.Loader.Loader.LoadFromResultSet(IDataReader rs, Int32 i, Object obj, Key key, String suffix, LockMode lockMode, ILoadable rootPersister, ISessionImplementor session)
at NHibernate.Loader.Loader.InstanceNotYetLoaded(IDataReader dr, Int32 i, ILoadable persister, String suffix, Key key, LockMode lockMode, Key optionalObjectKey, Object optionalObject, IList hydratedObjects, ISessionImplementor session)
at NHibernate.Loader.Loader.GetRow(IDataReader rs, ILoadable[] persisters, String[] suffixes, Key[] keys, Object optionalObject, Key optionalObjectKey, LockMode[] lockModes, IList hydratedObjects, ISessionImplementor session)
at NHibernate.Loader.Loader.GetRowFromResultSet(IDataReader resultSet, ISessionImplementor session, QueryParameters queryParameters, IList hydratedObjects, Object optionalObject, Object optionalId, Key[] keys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Object optionalObject, Object optionalId, Object[] optionalCollectionKeys, Boolean returnProxies)
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes)
at NHibernate.Hql.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters)
I guessing that this is being caused by the fact that the <any> entity class's name is being persisted like this...
Code:
Framework.Core.Entities.DeliveryJob, Framework.Core, Version=1.0.2119.16496, Culture=neutral, PublicKeyToken=ce0a415fb14adce2
..and after recompilation the Version value is updated to a new value which no longer matches.
Is this by design or a bug? If it's by design then what's the workaround? I don't want to have this error thrown for pre-existing data just because I recompile for a bug fix!
Hope someone out there can help...
Cheers,
Symon.