Ok, I'm starting to think this is an issue I should add to the
tracker. I created a test project with a simple entity in a separate
assembly and tried the follow scenarios:

Assembly referenced by main assembly - Pass
Assembly dynamically loaded by main assembly in the same directory as
main - Pass
Assembly dynamically loaded from subdirectory - Fail


On Jan 7, 2:08 pm, ksc654 <[email protected]> wrote:
> After an entire day trying to resolve this error I am no closer to
> having it resolved. The assemblies in question are being loaded from a
> "Plugins" subdirectory. I tried moving them to the main application
> directory but had to backtrack because I ran into issues with my
> plugin manager trying to dynamically load assemblies which were
> already loaded as reference assemblies.
>
> I could really use some help with this.
>
> On Jan 6, 11:06 am, ksc654 <[email protected]> wrote:
>
>
>
> > 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