Solved

C# Application.StartupPath changed by NUnit

Posted on 2008-10-03
3
1,331 Views
Last Modified: 2013-12-17
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
Comment
Question by:RishadanPort
  • 2
3 Comments
 
LVL 55

Expert Comment

by:Jaime Olivares
ID: 22638967
Does the startup folder is the same as your .exe file?
If so, you can use ExecutablePath instead.
0
 
LVL 6

Accepted Solution

by:
RishadanPort earned 0 total points
ID: 22644080
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
 
LVL 6

Author Comment

by:RishadanPort
ID: 22644088
*calling the function ---> calling routines embedded in the EXE
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Flash (http://en.wikipedia.org/wiki/Adobe_Flash) has evolved over the years to where it has become a masterful tool for displaying content screen.  It has excellent layout placement, UI precision as well as rendering capabilities. This, along with t…
This article describes relatively difficult and non-obvious issues that are likely to arise when creating COM class in Visual Studio and deploying it by professional MSI-authoring tools. It is assumed that the reader is already familiar with the cla…

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question