Thanks, it works.

Setting with "Copy if newer" the "Copy to output directory" property
of Hibernate.cfg.xml file ad using this snippet to retrieve del file
path:

            string codeBasePath = new
Uri(typeof(SqlHelper).Assembly.CodeBase).LocalPath;
            string configPath =
Path.GetDirectoryName(Path.GetFullPath(codeBasePath));
            string nhConfig = configPath + "\\" + "hibernate.cfg.xml";

(is the same code posted by Jeff, but it is clearer to me... )

The Ui, launched throught TDD, started to work properly.
Also CCNET tests and NCover works in the right way.

Bye
Paolo

On Jan 3, 9:11 pm, Jeff Brown <[EMAIL PROTECTED]> wrote:
> For example, choose a path that is relative to your assembly's codebase
> directory.
>
> eg.  Path.GetDirectoryName(Path.GetFullPath(new
> Uri(typeof(MyType).Assembly.CodeBase).LocalPath))
>
> (This won't work for remotely loaded assemblies mind you.)
>
> Jeff.
>
> ________________________________
>
> From: [email protected] [mailto:[EMAIL PROTECTED]
> On Behalf Of Jay Flowers
> Sent: Thursday, January 03, 2008 11:07 AM
> To: [email protected]
> Subject: MbUnit Re: & Nhibernate configuration file
>
> Define a path that is not dependent on the current working directory.
>
> On 1/3/08, Paolo <[EMAIL PROTECTED]> wrote:
>
>         Hi,
>
>         I have just changed my unit test framework from Nunit to MbUnit.
>         If I run tests using command line commands everything go, but If
> I run
>         test using MbUnit Gui, tests fail, because the program search
> for Nh
>         configuration file in the wrong place, infact the file is in the
> same
>         folder of test dlls but the gui search for it in the root folder
> of
>         the project. Why? How can I solve this problem?
>
>         The same happen when I run test using CCNET.
>
>         Paolo.
>
> --
> Jay Flowers
> ----------------------------------------------------------------------http://jayflowers.com
> ---------------------------------------------------------------------
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"MbUnit.User" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/MbUnitUser?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to