views:

679

answers:

3

I followed this tutorial to make NUnit tests debugable in Visual Studio. In the debugging options I set "Start external program:" to C:\Program Files\NUnit 2.4.8\bin\nunit-x86.exe. Is there a way to get the program files directory dynamically to avoid problems when other people work with this solution on their system?

A: 

The environment variable $PROGRAMFILES holds this. Most properties in visual studio allow you to use environment variable expansion like this: "$(PROGRAMFILES)\NUnit 2.4.8\"

1800 INFORMATION
I had already tried this. The problem was that I had used the IDE instead of manipulating the *.csproj.user file directly. But now it works as it should.Thanks!
h0b0
A: 

Yes there is:

Environment.GetEnvironmentVariable("ProgramFiles")
David M
A: 

%ProgamFiles% if using in a Windows path.

MaSuGaNa