Hi,
I am having trouble with a "Association references unmapped class" exception. I have checked everything I can think of and no luck. This comes up during initiation of session factory.
Using VS 2005, SQL Server 2005, NHibernate 1.0.2.0
All my hbm.xml files are in the VS 2005 project as "Embedded Resources"
The strange thing is that it was all running fine a couple of hours ago. I made some changes (non NH related) and added one hbm.xml file to the project, not related to the one which features in the error below.
Is anyone aware of a VS2005 bug which doesnt "Embed" resources? seems like it doesnt make a difference whether the xml file is included or excluded from the project.
Help would be greatly appreciated.
Mapping documents:
Code:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" schema="dbo">
<class name="Seamless.Security.UserGroupRole, Seamless.Security" table="secUserGroupRole">
<id name="id" type="Int32" column="userGroupRoleId">
<generator class="native" />
</id>
<many-to-one name="objGroup" column="groupId" class="Seamless.Security.Group, Seamless.Security" />
<many-to-one name="objRole" column="roleId" class="Seamless.Security.Role, Seamless.Security" />
<many-to-one name="objUser" column="userId" class="Seamless.Security.User, Seamless.Security" />
</class>
</hibernate-mapping>
Inner Exception & Stack trace:Quote:
Association references unmapped class: UserGroupRole
Code:
at NHibernate.Cfg.Binder.BindCollectionSecondPass(XmlNode node, Collection model, IDictionary persistentClasses, Mappings mappings)
at NHibernate.Cfg.Binder.CollectionSecondPass.SecondPass(IDictionary persistentClasses)
at NHibernate.Cfg.Binder.AbstractSecondPass.DoSecondPass(IDictionary persistentClasses)
at NHibernate.Cfg.Configuration.SecondPassCompile()
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Seamless.Core.NHibernateBase.NHibernateSessionManager.InitSessionFactory() in C:\Dev\SeamlessCMS\SeamlessBaseSolution\Seamless.Core\DAO\NHibernateBase\NHibernateSessionManager.cs:line 69
at Seamless.Core.NHibernateBase.NHibernateSessionManager..ctor() in C:\Dev\SeamlessCMS\SeamlessBaseSolution\Seamless.Core\DAO\NHibernateBase\NHibernateSessionManager.cs:line 37
at Seamless.Core.NHibernateBase.NHibernateSessionManager.Nested..cctor() in C:\Dev\SeamlessCMS\SeamlessBaseSolution\Seamless.Core\DAO\NHibernateBase\NHibernateSessionManager.cs:line 46