I once saw the source code of a winform
application and the code had a Console.WriteLine();
. I asked the reason for that and i was told that it was for
It wouldn't perform anything unless the Really, they should be leveraging Console
was redirected to say the Output
window.Debug.WriteLine
instead.
The benefit of Debug.WriteLine
is that it gets optimized away when building in Release
mode.
NOTE: as pointed out by Brad Christie and Haedrian, apparently it will in fact write to the Console
window in Visual Studio when running a Windows Forms application. You learn something new every day!