C# – NHibernate Fluent Automapping Across DLLs

cfluent-nhibernatenetnhibernatenhibernate-mapping

I have a Person class in 1 project/dll and a StandardUser class that derives from Person in another project/dll. I have a Password class that contains a StandardUser (Password and StandardUser are in the same dll).

I can't seem to get the fluent automapping to work with this scenario.

It tells me:
NHibernate.MappingException: An association from the table Password refers to an unmapped class: DomainModel.Users.DomainObjects.StandardUser

If I move the Person class to the same dll as StandardUser, then it works. It also works if Password contains a Person instead of a StandardUser.

Am I missing something or is this not supported with Fluent Automappings?


Edit/Answer: It appears that you have to map the StandardUser's assembly in the AutoMappings.Add BEFORE you map the base class. I'm not sure if this is by design or a bug.

Best Answer

It appears that you have to map the StandardUser's assembly in the AutoMappings.Add BEFORE you map the base class. I'm not sure if this is by design or a bug.

Related Topic