I use VS Code and Tye (https://github.com/dotnet/tye) to run the set of .Net services. I need to configure the VS Code to attach to the service/process that was started by Tye. I can configure the task in tasks.json to run the Tye with the service in debug mode. On run, Tye prints smth like the following /^.*Listening for event pipe events for my-servce(.*) on process id (\d+)$/
How to configure tasks/launch.json in VS Code to:
- Run Tye and wait for the "Listening ..." string
- As soon as the string is detected, extract process Id (Tye is still running)
- Attach the debugger to the process Id extracted
- On detach - terminate Tye
?
I have found that the easiest way to debug using Tye is:
tye run --debug *