-->
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.  [ 5 posts ] 
Author Message
 Post subject: NHibernate deployment (Deploying assemblies)
PostPosted: Sun Aug 05, 2007 3:14 pm 
Newbie

Joined: Sun Aug 05, 2007 3:04 pm
Posts: 4
Hi,
So, happily finally downloaded Nibernate, got a zip file full with .Net assemblies. But i do not find any documentation about the deployment of that assemblies:
I have 3 projects: GUI, biz logic, entities. The only one who uses the NHibernate logic is the biz logic, it contains the Services.
1. if i only put NHibernate.dll in the biz logic bin - the other assemblies are missing to the application and there is run-time error regarding this.
2. If i do put all the assemblies in the biz logic - nothing will make them copy to the aplication/GUI bin (should i put build events)?
3. If i put all the assemblies in the GUI, everything works fine, but this is incorrect way to structure the solution since the biz logic is responsible for that assemblies (and to deploy them).

What should i do?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 3:53 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
You may put the NHibernate DLLs anywhere you like. Just add a reference to NHibernate.dll from your "biz logic" project. Your GUI project should copy anything that is referenced from your biz logic project. This is true with any code library you use, not just NHibernate.

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 5:01 pm 
Newbie

Joined: Sun Aug 05, 2007 3:04 pm
Posts: 4
Hi, thanks for your reply.
What i'm missing here is: How will the NHibernate.dll should find his friends? If i will put them all together in biz logic there is no way for this dll to know that they are there and they will not be copied to the application bin. If i put them all in the application, rebuilding the solution will delete them (since they are not refernced from the application project).

Moreover, if i don't put manually the assembly log4net.dl in the application binl, i receive run time error about it. Probably it's me, but i'm missing some deployment concept here.


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 5:29 pm 
Hibernate Team
Hibernate Team

Joined: Tue Jun 13, 2006 11:29 pm
Posts: 315
Location: Calgary, Alberta, Canada
Put NHibernate in some common place like C:\Program Files\NHibernate, not in your app's bin directory.

NHibernate.dll does not find its friends automatically. You need to manually add the references for any DLL that NHibernate.dll would need from your biz logic project; that typically includes at least log4net.dll and Iesi.Collections.dll. If your app complains about missing DLLs, just keep adding references to the missing DLL until there is no more such complain.

I typically set up my solution this way (not necessarily the right way, but a way):

Code:
Solution Directory
|-- lib
      |-- NHibernate (a copy of all DLLs)
      |-- Other Library
|-- Project 1
|-- Project 2
|-- ...
|-- Project n


The projects will reference ..\lib\NHibernate\NHibernate.dll and other DLLs that NHibernate depends on. When you compile your solution, VS2005 will empty your bin directory and re-copy the DLLs from ..\lib\NHibernate.

_________________
Karl Chu


Top
 Profile  
 
 Post subject:
PostPosted: Sun Aug 05, 2007 7:26 pm 
Newbie

Joined: Sun Aug 05, 2007 3:04 pm
Posts: 4
Thanks for you excellent answer.


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

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.