Solved

C# Application.StartupPath changed by NUnit

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
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…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

13 Experts available now in Live!

Get 1:1 Help Now