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 ?
|