Hibernate version: 1.0.2
How do I load the mapping files from an assembly which is not located in a subdirectory of the application instead of directly in the application directory?
At the moment I get always an error:
NHibernate.MappingException: persistent class myNamespace.myClass, myAssembly not found ---> System.TypeLoadException: Could not load type 'myNamespace.myClass, myNamespace.myClass', check that type and assembly names are correct
What I do is the following:
Code:
cfg = new Configuration();
log.Info("Extract configuring file from " + Assembly.GetExecutingAssembly());
cfg.Configure(Assembly.GetExecutingAssembly(), "myNamespace.Hibernate-JetDb.cfg.xml");
log.Info("Extract mapping files from " + Assembly.GetExecutingAssembly());
cfg.AddAssembly(Assembly.GetExecutingAssembly(), true);
log.Info("Build session factory.");
factory = cfg.BuildSessionFactory();
The configuration will be read in without any problems. The mapping file will be read in too. But the persistent class can not be found.
It is a really big problem for me because I can not change the directory structure and have to place the related dll into a subdirectory instead of the application directory.
For test purposes I put the assembly in the main directory an it seems to work.
[/code]