My understanding is that you need to register a listener to the trace output, but how would that even look like? Is there a trace stream associated with each execution of the application that Visual Studio/Rider listens to?
We can rephrase this question by asking:
How to write a simple console app that executes another application and listen to its trace output.
To receive another application's debugging output, you need to attach to it as a debugger and call the WaitForDebugEvent
function, looking for OUTPUT_DEBUG_STRING_INFO
results (dwDebugEventCode == OUTPUT_DEBUG_STRING_EVENT
)
If the other application is .NET, you potentially have some easier options, including configuring additional trace listeners in the app.config
.