Starting a process using Visual Studios' DTE with debugger attached

Viewed 24

We are developing an application "Configurator" that configures a job and then starts one or more applications "Processor"s that are processing these jobs.

Originally, there were no separate processes, and we were able to debug a single application with the debugger attached. Now, we have split the application into a "Configurator" and a "Processor" for several reasons.

As there are two application that we want to debug during development, this is a problem now, since Visual Studio attached the debugger only to the startup application. I know there is a feature for multiple startup projects, but this only works if the applications are started at the same time.Here, only our "Configurator" is started and the "Processor" is started at a later time using Process.Start.

So I thought this is not such a big problem and during development we can attach to the running DTE instance and attach the debugger using DTE.Debugger.Attach(). BUT: Visual Studio has its own process handling and a different Process structure, and I need to find the associated VS Process from the real Process using DTE.Debugger.LocalProcesses.

While this generally works, it is extremely slow iterating through DTE.Debugger.LocalProcesses.

So my question is if there is any chance of using the DTE to start a process directly, like DTE.Debugger.StartProcess()?

As far as I have seen, there is an IVsDebugger with the possibility to launch something, but I have no clue if I have access to it using the DTE and how to use it?

It seems that a similar question has been asked already here: How to retrieve IVsDebugger from external DTE for automation in Visual Studio 2019.

0 Answers
Related