The system i'm building has 4 separate applications that in production, are 4 distinct win32 services. During development I run them as 4 separate console applications. These programs need to be started in a specific order.
I do this from VS2010 by right clicking on each project and select debug > start a new instance. This works but is painfully slow.
I attempted to use run "Multiple startup projects", but they all start at the same time. Changing the start order does not help.
So, what i want to do is to use MSBuild to start each program from a build script. I attempted to use the Exec Task but the programs are not launched as debugged processes..
Since all of VS is based on msbuild, i know there must be a way to launch a project this way..
You can use a mix of Pre/Post build events for this. You can modify them in
Project Properties -> Build Events for the last project.
// Build is going to replace these files, they must not be in use taskkill /IM Foo.exe taskkill /IM Bar.exe
// VsJITDebugger will ask for which debugger to attach, you can // choose currently active VS instance VsJITDebugger.exe $(SolutionDir)\Foo\bin\Debug\Foo.exe VsJITDebugger.exe $(SolutionDir)\Bar\bin\Debug\Bar.exe
Launching debugger on each build may get bit annoying :) Better would be to use a batch script for the last project. You can do it in
Project Properties -> Debug -> Start external program.
I did not find a solution.. I put a different hard-coded delay into each app and launched it with Debug "multiple start-up projects".. A bit of a hack but simple is better.