dwmkerr / consolecontrol

ConsoleControl is a C# class library that lets you embed a console in a WinForms or WPF application.
MIT License
723 stars 169 forks source link

Attach an existing process output to console control #26

Open FrancoTampieri opened 7 years ago

FrancoTampieri commented 7 years ago

Hi,

I'm developing a WPF application, and I would like to know If I can attach the console output of that application to the Console control.

For example I would like to open a new windo with a button and show in that window the consolecontrol with the Nlog output of the main application.

Regards

Franco

feldrim commented 7 years ago

This issue is what I was searching on Stackoverflow and Google. I'm pretty surprised.

My attempt was adding a troubleshooting button on my own WPF window component that opens a new console window. So that I can see the trace output when I interact with the window. So that I -or help desk guy- can recreate the error in the help desk ticket without needing to open the solution in VS. Because help desk can't and shouldn't. I need to help them diagnose better and give the development more meaningful insight to help solving the issue. And if it is not a bug but a user fault or a user fault that occurs because of bad UI, they can help the user asap and give us a suggestion to develop the UI.

imtrobin commented 6 years ago

Am interested too, did you figure it out?

pearlxcore commented 5 years ago

string arg1 = "myprogram.exe"; string arg2 = "-h"; console.StartProcess(arg1, arg2);

or

console.StartProcess("myprogram.exe", null);