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: Configuration.Configure(specificConfigFilePath)
PostPosted: Tue Apr 10, 2007 1:22 pm 
Expert
Expert

Joined: Fri Oct 28, 2005 5:38 pm
Posts: 390
Location: Cedarburg, WI
Hibernate version: 1.20CR1

For reasons unfathomable to me, my superiors insist that we put the NHibernate configuration in our application's config file rather than in nhibernate.cfg.xml. However, our application's config file does not follow the normal name and location for app.config.

If I do this:
Code:
NHibernate.Cfg.Configuration configuration = new NHibernate.Cfg.Configuration();
configuration.Configuration(ourConfigFilePath);


I get an exeption that there is no element
Code:
<session-factory xmlns='urn:nhibernate-configuration-2.2'>


If I try to set up our config file with the format NHibernate expects in nhibernate.cfg.xml, I get exceptions about Configure() choking on other configuration sections in our file that it doesn't recognize.

How can I tell NHibernate the config file location to use, and still have it be in the app.config format?


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.