Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

C# Application.StartupPath changed by NUnit

Posted on 2008-10-03
3
Medium Priority
?
1,394 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

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…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

876 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