Visual Studio 2008: How to redirect Trace, Debug and Console output to the Output window?

萝らか妹 提交于 2019-12-10 10:51:30

问题


I have noticed recently that the Visual Studio "Output window" stopped writing out my Debug.WriteLine messages in my WinForms application. It does neither output the Trace.WriteLine messages. I have also used DebugView while running this application and it shows nothing.

I am sure it worked in some VS projects some time ago - the output contained Debug messages. We also have a project that we regularly debug in production using the DebugView tool and it shows all Trace.WriteLine messages.

However, I just found out that currently in my Visual Studio, Console.WriteLine now writes to the VS Output window while the Trace and Debug.WriteLine do not.

How to control the redirections of Debug Trace and Console outputs within Visual Studio?


回答1:


Trace, Debug, and Console go to the Output window if you select Debug in the Show output from drop down and the Program Output option is selected (right click in output window).

AFAIK console is only redirected to output for non-console applications. Check the project properties and make sure it says either Class Library or Windows Application in the output type drop down.



来源:https://stackoverflow.com/questions/2418241/visual-studio-2008-how-to-redirect-trace-debug-and-console-output-to-the-outpu

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!