Is it possible to run an external program from the target directory during debugging?

When debugging, I need to run an external program from the target build directory, and I wonder if it can be executed 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 on the debug tab for the project properties, I set "Run external program" in MyExecutable.exe, but I get a failure when starting debugging. It seems I need to put the full path for this.

Is there a way to do this using relative paths?

+4
debugging visual-studio
source share
3 answers

The "Start external program" path refers to your solution catalog (in VS2005 anyway). Therefore, you can simply put:

Source\Lib\MyExecutable.exe 

I see that you asked about this a while ago, but I just ran into the same problem, and that is how I solved it.

+5
source share

(_ Disclaimer: all directions are based on VS08. Things may be in different places in previous or future versions)

I get the feeling that your other program is not a post-build phase that you need to complete before debugging, but rather a program that should also start (server or something else), as well as during debugging.

Use an empty C ++ Make-File project (you can use other types of projects, but by default it has no actual building, so I consider it the easiest) and change its launch properties (Project / Properties → Debug) to start another application . Then install the solution to run several projects (Solution / Properties → Common Properties → Startup Project).

+2
source share

Have you tried something like $ (TargetDir) \ .. \ Lib?

-one
source share

All Articles