C# Application.StartupPath changed by NUnit

I am running tests on my application using NUnit; my application uses the field "Application.StartupPath" to get the current directory of the program.

However, when I run tests using NUnit, the Application.StartupPath is changed to refer to NUnit.exe's start up path. How would I correct this?
LVL 6
RishadanPortAsked:
Who is Participating?
 
RishadanPortConnect With a Mentor Author Commented:
It turns out that NUnit creates a copy of the EXE and runs it internally rather then calling the function.
Using the Executable Path, or using Application.StartUp does not work.

I just decided to move all my files I needed to the NUnit directory, and this works fine.
0
 
Jaime OlivaresSoftware ArchitectCommented:
Does the startup folder is the same as your .exe file?
If so, you can use ExecutablePath instead.
0
 
RishadanPortAuthor Commented:
*calling the function ---> calling routines embedded in the EXE
0
All Courses

From novice to tech pro — start learning today.