Solved

C# Application.StartupPath changed by NUnit

Posted on 2008-10-03
3
1,313 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

813 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now