Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio post build events stuck waiting for executable to finish before running app in debug mode

Part of the post build on my project is the execution of a program I wrote for testing the main application. Unfortunately, the post build process in visual studio locks up waiting for the executable to exit. So, i'm stuck closing my test program in order to have the post build process complete and my application run. How do I change this so VS does not wait for the program to return before launching? Thanks.

like image 334
max Avatar asked Aug 31 '09 08:08

max


4 Answers

I also found that the start trick didn't work and downloading a separate tool to complete such a simple task seemed excessive. After some additional searching I found this SO post which gave an answer that worked for my needs.

Just replace <actual-command-line-to-run> with your command. Remember to give the full path to the executable and encapsulate it in "quotes" if there's spaces in your path.

powershell start-process <actual-command-line-to-run>
like image 172
Grinn Avatar answered Nov 20 '22 10:11

Grinn


Wow, seems VS is really stubborn about this.

You can use this little tool that can launch apps without showing cmd windows (among other things). In your post build event:

c:\path\to\cmdow /run app.exe
like image 44
javs Avatar answered Nov 20 '22 11:11

javs


This seems to be a known issue of VS 2010 (e.g. here and here) and it seems it won't be fixed that soon.

Regarding a possible workaround, similar to the one mentioned by @RichieHindle, one of the MS Connect persons suggests:

START /WAIT cmd /c YourPostBuildTool.exe
like image 4
superjos Avatar answered Nov 20 '22 11:11

superjos


Running your test program via start might work. Change your post build step from this:

runtest.exe

to this:

start runtest.exe
like image 1
RichieHindle Avatar answered Nov 20 '22 10:11

RichieHindle