473,407 Members | 2,546 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Nhibernate

Hi,
I am using the configuration object and passing it a Assembly object
to load. The assembly object i pass in is from a dll which is in a
different folder then the Nhibernate dll.

The AddAssembly(Assembly assembly) function throws me an Error saying
it can't load the configuration hbm.xml file because it can't load the
assembly in the hbm.xml file.

Why does NHibernate try to load the Assembly again??

May 10 '07 #1
4 3307

"IceMan" <an***********@gmail.comwrote in message
news:11*********************@n59g2000hsh.googlegro ups.com...
Hi,
I am using the configuration object and passing it a Assembly object
to load. The assembly object i pass in is from a dll which is in a
different folder then the Nhibernate dll.

The AddAssembly(Assembly assembly) function throws me an Error saying
it can't load the configuration hbm.xml file because it can't load the
assembly in the hbm.xml file.

Why does NHibernate try to load the Assembly again??

I think NHibernate tries to load the mapping files from the assembly when
using Configuration.AddAssembly(Assembly asm). Has the hbm.xml file been
compiled into the assembly as an Embedded Resource?

May 10 '07 #2
On May 10, 2:38 pm, "Dave Shooter"
<alwayskeepitloa...@delete.me.googlemail.comwrot e:
"IceMan" <andreas.sk...@gmail.comwrote in message

news:11*********************@n59g2000hsh.googlegro ups.com...
Hi,
I am using the configuration object and passing it a Assembly object
to load. The assembly object i pass in is from a dll which is in a
different folder then the Nhibernate dll.
The AddAssembly(Assembly assembly) function throws me an Error saying
it can't load the configuration hbm.xml file because it can't load the
assembly in the hbm.xml file.
Why does NHibernate try to load the Assembly again??

I think NHibernate tries to load the mapping files from the assembly when
using Configuration.AddAssembly(Assembly asm). Has the hbm.xml file been
compiled into the assembly as an Embedded Resource?
Yes, i have made the hbm.xml file an embedded resource, and it works
if the nhibernate and the assembly with the mapping file is in the
same folder.

But it appears that NHibernate tries to load the assembly from the
location NHibernate was loaded from.

But i don't understand why the assembly has to be loaded again. As I
am guesing it most allready be loaded when i have been able to create
other types from that assembly.

May 11 '07 #3
IceMan,

By a quick look in the code of NHibernate(version 1.0.2 though) that i
had on my disk the only calls that NHibernate do with the assembly are

assembly.GetManifestResourceNames() - to get an array of all resources
inside the assembly(to be able to pull out all "hbm.xml" resources)

and

assembly.GetManifestResourceStream( fileName ) to get the stream to a
specific file

NHibernate does not try to reload the assembly.

/chanchitodata

On May 11, 3:39 am, IceMan <andreas.sk...@gmail.comwrote:
On May 10, 2:38 pm, "Dave Shooter"

<alwayskeepitloa...@delete.me.googlemail.comwrot e:
"IceMan" <andreas.sk...@gmail.comwrote in message
news:11*********************@n59g2000hsh.googlegro ups.com...
Hi,
I am using the configuration object and passing it a Assembly object
to load. The assembly object i pass in is from a dll which is in a
different folder then the Nhibernate dll.
The AddAssembly(Assembly assembly) function throws me an Error saying
it can't load the configuration hbm.xml file because it can't load the
assembly in the hbm.xml file.
Why does NHibernate try to load the Assembly again??
I think NHibernate tries to load the mapping files from the assembly when
using Configuration.AddAssembly(Assembly asm). Has the hbm.xml file been
compiled into the assembly as an Embedded Resource?

Yes, i have made the hbm.xml file an embedded resource, and it works
if the nhibernate and the assembly with the mapping file is in the
same folder.

But it appears that NHibernate tries to load the assembly from the
location NHibernate was loaded from.

But i don't understand why the assembly has to be loaded again. As I
am guesing it most allready be loaded when i have been able to create
other types from that assembly.

May 12 '07 #4
Hi,

I solved the problem by adding a eventhandler to
"AppDomain.CurrentDomain.AssemblyResolve" and looking for the dll my
self

thanks
On May 12, 6:07 pm, chanchitodata <chanchitod...@gmail.comwrote:
IceMan,

By a quick look in the code of NHibernate(version 1.0.2 though) that i
had on my disk the only calls that NHibernate do with the assembly are

assembly.GetManifestResourceNames() - to get an array of all resources
inside the assembly(to be able to pull out all "hbm.xml" resources)

and

assembly.GetManifestResourceStream( fileName ) to get the stream to a
specific file

NHibernate does not try to reload the assembly.

/chanchitodata

On May 11, 3:39 am, IceMan <andreas.sk...@gmail.comwrote:
On May 10, 2:38 pm, "Dave Shooter"
<alwayskeepitloa...@delete.me.googlemail.comwrot e:
"IceMan" <andreas.sk...@gmail.comwrote in message
>news:11*********************@n59g2000hsh.googlegr oups.com...
Hi,
I am using the configuration object and passing it a Assembly object
to load. The assembly object i pass in is from a dll which is in a
different folder then the Nhibernate dll.
The AddAssembly(Assembly assembly) function throws me an Error saying
it can't load the configuration hbm.xml file because it can't load the
assembly in the hbm.xml file.
Why does NHibernate try to load the Assembly again??
I think NHibernate tries to load the mapping files from the assembly when
using Configuration.AddAssembly(Assembly asm). Has the hbm.xml file been
compiled into the assembly as an Embedded Resource?
Yes, i have made the hbm.xml file an embedded resource, and it works
if the nhibernate and the assembly with the mapping file is in the
same folder.
But it appears that NHibernate tries to load the assembly from the
location NHibernate was loaded from.
But i don't understand why the assembly has to be loaded again. As I
am guesing it most allready be loaded when i have been able to create
other types from that assembly.

May 14 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Aquila Deus | last post by:
The documents on their website are completely wrong. Following is the a real example that works with NHibernate 1.0.2.0: <?xml version="1.0" encoding="utf-8"?> <configuration...
1
by: Hoffmania | last post by:
Is there a good tutorial of getting databinding working with NHibernate collections such as bags with lazy loading. I can access the collection programaticly, but not directly with databinding.
1
by: erin.sebastian | last post by:
Hello All, I am new to hibernate and new to nHibernate. I created a small app and when i try and run it i get the error i posted at the bottom of this message. I am using the helper class that...
5
by: gaddoz | last post by:
Hi all, I'm trying to set up a .NET webservice using in data access layer Nhibernate (nhib 1.2.0 beta). The first trouble I met was that a webservice cannot serialize Interfaces, like IList<>....
0
by: TigrouMeow | last post by:
Hello, I'm trying to make a "clean" webservice, using Nhibernate. I'm facing some issues, but i'm quite the beginner with that kind of system. When there are more than 2 clients connected on my...
0
by: beantaxi | last post by:
Hello all, I'm trying to write a simple program, using VS C# 2005 Express and SQL Server Express with NHib 1.0.2. No matter what I try, I'm unable to connect: cannot open connection at...
0
by: Pieter | last post by:
Hi, I'm using NHibernate 1.2 (CR1), and I'm using a custom list (inherited from BindingList(Of T) ) for all my lists. The NHibernate documentation told me that I had to implement...
1
by: Alexander Vasilevsky | last post by:
Does the number NHibernate download data? For example, first can be downloaded 100 rows of data, and then as necessary podgruzhat else. Where can I read about NHibernate and its potential? ...
14
by: thj | last post by:
Hi, I was wondering what you guys are using and why? LINQ to SQL or NHibernate? Thanks in advance, Tommy
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.