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: Nhibernate.cfg.xml not found when using NUnit
PostPosted: Tue Aug 08, 2006 8:53 am 
Newbie

Joined: Tue Aug 08, 2006 8:42 am
Posts: 1
I am using Nhibernate in a standard "Console Application".
To test it, I did a "Main()" in the same assembly and it works well.
Then I created another "Test project" and started to implement some NUnit tests to validate my code, but it does not work well any more.
The problem is that the application can't find the file "Nhibernate.cfg.xml", although I haven't changed anything in my hibernate code. I get the following exception :

NHibernate.HibernateException: problem parsing configuration : System.IO.FileNotFoundException: Could not find file 'C:\Documents and Settings\Julien\Mes documents\Visual Studio 2005\Projects\fr.obeo.sample.nonreg.nhibernate\TestResults\Julien_PCJDUPONT 2006-08-08 14_45_53\Out\hibernate.cfg.xml'.

and my code is the following:


_sessions = new Configuration()
.Configure("hibernate.cfg.xml")
.BuildSessionFactory();

What I also did is to copy my Main() function in another assembly (not a test project), and it works well in this case.
Does somebody has any idea why it does not work well when I use NUnit or what I am not doing well ?


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.