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?
我按照本教程在Visual Studio中调试NUnit测试。在调试选项中,我将“启动外部程序:”设置为C:\ Program Files \ NUnit 2.4.8 \ bin \ nunit-x86.exe。有没有办法动态获取程序文件目录,以避免其他人在他们的系统上使用此解决方案时出现问题?
2 个解决方案
#1
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\"
环境变量$ PROGRAMFILES持有这个。 visual studio中的大多数属性允许您使用如下环境变量扩展:“$(PROGRAMFILES)\ NUnit 2.4.8 \”
#2
%ProgamFiles% if using in a Windows path.
%ProgamFiles%,如果在Windows路径中使用。
#1
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\"
环境变量$ PROGRAMFILES持有这个。 visual studio中的大多数属性允许您使用如下环境变量扩展:“$(PROGRAMFILES)\ NUnit 2.4.8 \”
#2
%ProgamFiles% if using in a Windows path.
%ProgamFiles%,如果在Windows路径中使用。