I'm using NHibernate 2.1.2.4000 and I'm attempting to load a series of
embedded mappings from assemblies:

            var configuration = new Configuration();
            configuration.Configure(Assembly.GetCallingAssembly(),
"MyNamespace.hibernate.cfg.xml");
            foreach (Assembly assembly in
AppDomain.CurrentDomain.GetAssemblies())
            {
                configuration.AddAssembly(assembly);
            }
            return configuration.BuildSessionFactory().OpenSession();

The hibernate.cfg.xml is also an embedded resource. It does not
contain any mapping references.

So anyway, when configuration.AddAssembly(assembly) is called I'm
getting a MappingException. Tracing through the exception stack leads
to a FileNotFoundException - "Could not load file or assembly ...".
The funny thing is that the assembly its trying to load is the same
assembly its reading the mapping resource from so its already loaded.

What I'm trying to accomplish is a pluggable domain model in which
everything needed to interact with a certain domain object is
contained in a single assembly. For instance the Employer assembly
contains Employer, EmployerView and EmployerPresenter. The persistence
layer is the only thing left to complete.

Any help would be appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/nhusers?hl=en.


Reply via email to