• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1477
  • Last Modified:

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?
0
RishadanPort
Asked:
RishadanPort
  • 2
1 Solution
 
Jaime OlivaresSoftware ArchitectCommented:
Does the startup folder is the same as your .exe file?
If so, you can use ExecutablePath instead.
0
 
RishadanPortAuthor 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
 
RishadanPortAuthor Commented:
*calling the function ---> calling routines embedded in the EXE
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now