-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: "Persistent class... not found" error
PostPosted: Wed Dec 24, 2008 12:07 pm 
Beginner
Beginner

Joined: Fri Jul 06, 2007 9:27 pm
Posts: 22
I am working on a small app to provide a GUI wrapper for SchemaExport. Here is the code I am using to configure NHibernate:

Code:
// Get assembly
Assembly assembly = Assembly.LoadFile(filePath);

// Configure NHibernate
Configuration configuration = new Configuration();
configuration.SetProperties(props);
configuration.AddAssembly(assembly);


Props is an IDictionary set up to work with SetProperties().

I am testing the app against a known working assembly, MyAssembly, that contains persistent classes and mapping files. MyAssembly maps without problem in the app I created it for.

Here's my problem: If I copy MyAssembly to the project output folder for my GUI wrapper app, NHibernate maps the classes in the assembly without problem. But if I move MyAssembly to any other location, AddAssembly() throws an error "Persistent class [ClassName, Assembly] not found."

I am passing the assembly as an object, rather than simply it's name. So I am puzzled by why it finds classes only if the assembly in located in the GUI wrapper's project output folder.

Can anyone shed any light on this? I can hack my way around the problem by copying the assembly, but that's got a really bad smell to it. Is there an optioal property I can set to eliminate the problem?

Thanks for your help.

David Veeneman
Foresight Systems


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.