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.
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>
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
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
Running your test program via start
might work. Change your post build step from this:
runtest.exe
to this:
start runtest.exe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With