1

Say I have a program that requires file I/O in the executable directory. Where would the executable for unit tests be located?

2 Answers 2

1

In code you can call Location:

System.Reflection.Assembly.GetExecutingAssembly().Location

If the loaded file was shadow-copied you need to use CodeBase to get the original location:

System.Reflection.Assembly.GetExecutingAssembly().CodeBase
0

After doing a debug output using StdOut in test results, it appears that it runs in

C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE 

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .