Hello,
I'm working with nHibernate.
I have make an Assembly (ex : DAL.dll), which contains the mapping files (.hbm.xml) and the entities (.cs). This Assembly has a strong name (signed).
I created a console project, which reference the DAL assembly (DAL.dll).
When I try to instanciate the Configuration, it fails when loading my DAL Assembly.
The error is the following :
NHibernate.MappingException: Could not compile the mapping document: DAL.Mappings.Cat.hbm.xml NHibernate.MappingException: persistent class DAL.Cat, DAL not found
This is the console application code :
Configuration cfg = new Configuration();
cfg.SetProperty(Environment.ConnectionDriver, "NHibernate.Driver.SqlClientDriver");
cfg.SetProperty(Environment.ConnectionString, dsn);
cfg.SetProperty(Environment.Dialect, typeof(MsSql2005Dialect).AssemblyQualifiedName);
cfg.SetProperty(Environment.ProxyFactoryFactoryClass, typeof(NHibernate.ByteCode.Castle.ProxyFactoryFactory).AssemblyQualifiedName);
cfg.SetProperty(Environment.ShowSql, "true");
cfg.SetProperty(Environment.ConnectionProvider, typeof(DriverConnectionProvider).AssemblyQualifiedName);
cfg.AddAssembly(typeof(DAL).Assembly);
The problem is that the hbm.xml files are referencing the entities like that :
<class name="DAL.Cat,DAL">
Is there another solution than referencing each class with their full name (with the key, etc.)
Thanks !