There is a WPF application with code

#if DEBUG Console.WriteLine("Debug informathion"); #endif 

How to redirect this Console.WriteLine to a separate window is the same as in a regular console application?

Note: the default output is output, but there is also information about debugging the program.

    2 answers 2

    You can also use the Debug class to output to a separate file or to EventLog

    How to add the console to the form

      I somehow created a Windows Forms application that I built with the Console Application option. The result was an application with two windows, console and main.