Today I've ran into a strange thing while testing my WPF app. Visual Studio was in Debug mode. I've created a routed event handler method and wanted to test if the calling was being done correctly, so I put Console.WriteLine("test");
into that method and I was expecting to see the output (the "test" word) in the Output window of the Visual Studio. There didn't appear anything, but I think it should have (tested later on by showing a MessageBox).
I thought it should have appeared, because before this, I was using Console
class to display messages to the output window, and it did allways work. So it quite surprise me, because this exact thing worked for me beforehand!
I found a "sollution", switching the project setting "Output type" to "Console App", but, as I expected, a Consolle appeared on the start of the application.
Could anyone please explain me how does the Console
methods work in wpf apps in the default setting, and possibly what to use for the correct behaviour in the debugging?