This was a beast to track down. Formerly I had implemented ILifecycle on my Domain superclass and everything worked great. After some refactoring however I decided to remove ILifecycle and got this exception
NHibernateMappingException 'could not interpret type Contact, Core.Contact'
This made no sense. In fact I wasn't using ILifecycle callbacks anywhere so why would I suddenly be required to implement this on my entities? I finally tracked this to the ClassBinder in NHibernate where it attempts to infer a type from the TypeFactory.HeuristicType(x) method, passing in the correctly parse class name 'Contact, Core.Contact'. Now what made this so difficult was that this was an attempt to load a type for a <map> element's <index> (key), where I was using a Contact for a key of a collection.
Since my entity had implemented ILifecycle, this bit of code would allow me to use my entity as a key in a dictionary (from TypeFactory.HeuristicType):
else if (typeof(ILifecycle).IsAssignableFrom(typeClass))
{
type = NHibernateUtil.Entity(typeClass);
}
I was basically 'cheating' without knowing it by implementing ILifecycle . I think it would be best practice to create a NHibernate IUserType for my Contact class to be able to use it as a key in a dictionary or use the <index-many-to-many> element. It has been some time since I checked this corner of my codebase and apparently my tests are insufficient or else I would have caught this.
So the bottom line is this...if you are receiving this error, check your collection mappings referencing the class in question; especially if they are used as indices for dictionaries.