NHibernate and assembly issue

P

Pierre

Hi,

In my C# project (VisitorManagement) I have a subfolder
(BusinessObjects) in which I have put the objects needed for NHibernate
and the mapping files.

In the top of my web service I do a using
VisitorManagement.BusinessObjects; and I'm able to use these objects.
But When I invoke the web service I get the following error.

Code C#:
cfg = new Configuration();
cfg.AddAssembly("VisitorManagement.BusinessObjects");

Error:
NHibernate.MappingException: Could not add assembly named:
VisitorManagement.BusinessObjects ---> System.IO.FileNotFoundException:
File or assembly name VisitorManagement.BusinessObjects, or one of its
dependencies, was not found.
File name: "VisitorManagement.BusinessObjects"

-----

Code C#:
cfg = new Configuration();
cfg.AddAssembly("VisitorManagement");

Error:
NHibernate.MappingException: persistent class
VisitorManagement.BusinessObjects.TblAuthorisationLevel,VisitorManagement.BusinessObjects
not found ---> System.IO.FileNotFoundException: File or assembly name
VisitorManagement.BusinessObjects, or one of its dependencies, was not
found.
File name: "VisitorManagement.BusinessObjects"


It works if I put all the classes in the same folder, but I'd rather
stick to this alternative as it looks way cleaner.

If anybody knows how to sort this problem, I'll be gratefull.

Best reguards,

Pierre
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top