调试时可以从目标目录启动外部程序吗? [英] Is it possible to start an external program from the target directory when debugging?
问题描述
调试时需要从构建目标目录启动一个外部程序,并且想知道是否可以使用相对路径来实现。
构建事件我有以下内容:
IF NOT$(ConfigurationName)==DebugGOTO End
:CopyExecutable
copy$(SolutionDir)\Source\Lib\MyExecutable.exe$(TargetDir)
:End
当我正在调试时,我需要运行MyExecutable.exe,因为在调试选项卡中的项目属性我设置启动外部程序到MyExecutable.exe,但运行调试时失败。看来我需要把这个工作的完整路径。
有没有办法使用相对路径?
启动外部程序路径是相对于您的解决方案目录(在VS2005中)。所以你可以:
Source\Lib\MyExecutable.exe
我看到你曾经问过这个问题,但我遇到同样的问题,这就是我解决的问题。 $ b
When debugging I need to start an external program from the target directory of a build and am wondering if it can be accomplished using relative paths.
As a post-build event I have the following:
IF NOT "$(ConfigurationName)"=="Debug" GOTO End :CopyExecutable copy "$(SolutionDir)\Source\Lib\MyExecutable.exe" "$(TargetDir)" :End
I need to run MyExecutable.exe when I am debugging so in the debug tab for the project properties I set "Start external program" to MyExecutable.exe but get a failure when running the debug. It seems I need to put the full path for this to work.
Is there a way to do this using relative paths?
The 'Start External Program' path is relative to your solution directory (in VS2005 anyway). So you could just put:
Source\Lib\MyExecutable.exe
I see you asked this a while ago, but I just ran into the same problem, and this is how I solved it.
这篇关于调试时可以从目标目录启动外部程序吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!