Discussion:
Current Working Directory
Kelly Anderson
2008-05-19 19:55:48 UTC
Permalink
In NUnit 2.5 alpha 2,

This:
string currentDir = Directory.GetCurrentDirectory();

Gives this value...
currentDir = "C:\\Program Files\\NUnit 2.5\\net-2.0"

I think this is different than it used to work, but it might just be a
setting as well..

-Kelly

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Charlie Poole
2008-05-20 21:02:41 UTC
Permalink
Hi Kelly,

Is this in a test or in your addin code? If the former, it's a bug,
because NUnit guarantees that each test is run with the current
directory set to the location of the test assembly. If it's in
an addin, there is no guarantee that applies to all addins,
but for those that load tests, it should also be the location
of the test assembly.

Charlie
-----Original Message-----
Behalf Of Kelly Anderson
Sent: Monday, May 19, 2008 9:56 PM
Subject: [nunit-developer] Current Working Directory
In NUnit 2.5 alpha 2,
string currentDir = Directory.GetCurrentDirectory();
Gives this value...
currentDir = "C:\\Program Files\\NUnit 2.5\\net-2.0"
I think this is different than it used to work, but it might
just be a setting as well..
-Kelly
--------------------------------------------------------------
-----------
This SF.net email is sponsored by: Microsoft Defy all
challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Kelly Anderson
2008-05-20 21:12:35 UTC
Permalink
It's using your DataSource. My Addin doesn't have anything to do with
this one. So, I think it's a bug at this point unless there is some
property or something I may have messed with inadvertently.

-Kelly

On Tue, May 20, 2008 at 3:02 PM, Charlie Poole
Post by Charlie Poole
Hi Kelly,
Is this in a test or in your addin code? If the former, it's a bug,
because NUnit guarantees that each test is run with the current
directory set to the location of the test assembly. If it's in
an addin, there is no guarantee that applies to all addins,
but for those that load tests, it should also be the location
of the test assembly.
Charlie
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
Charlie Poole
2008-05-20 21:29:11 UTC
Permalink
Hi Kelly,
Post by Kelly Anderson
It's using your DataSource. My Addin doesn't have anything to
do with this one. So, I think it's a bug at this point unless
there is some property or something I may have messed with
inadvertently.
I didn't mean /your/ addin, but whether we are talking test
code or addin code, since the rules are defined in one case
and undefined in the other - until we decide upon some
guarantee.

So, do you mean it's code in the property with DataSourceAttribute?
If so, that's a new area and I'm open to proposals about whether
the current directory should be guaranteed and - if so - to what.

Charlie
Post by Kelly Anderson
-Kelly
On Tue, May 20, 2008 at 3:02 PM, Charlie Poole
Post by Charlie Poole
Hi Kelly,
Is this in a test or in your addin code? If the former,
it's a bug,
Post by Charlie Poole
because NUnit guarantees that each test is run with the current
directory set to the location of the test assembly. If it's in an
addin, there is no guarantee that applies to all addins, but for
those that load tests, it should also be the location of the test
assembly.
Charlie
--------------------------------------------------------------
-----------
This SF.net email is sponsored by: Microsoft Defy all
challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
nunit-developer mailing list
https://lists.sourceforge.net/lists/listinfo/nunit-developer
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

Loading...