Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

C# Application.StartupPath changed by NUnit

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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In my previous article (http://www.experts-exchange.com/Programming/Languages/.NET/.NET_Framework_3.x/A_4362-Serialization-in-NET-1.html) we saw the basics of serialization and how types/objects can be serialized to Binary format. In this blog we wi…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

839 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