Visual Studio 2008:如何将Trace,Debug和Console输出重定向到Output窗口? [英] Visual Studio 2008: How to redirect Trace, Debug and Console output to the Output window?

查看:332
本文介绍了Visual Studio 2008:如何将Trace,Debug和Console输出重定向到Output窗口?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近注意到,Visual Studio输出窗口停止在我的WinForms应用程序中写出我的Debug.WriteLine消息。它既不输出Trace.WriteLine消息。我也在运行这个应用程序时使用了 DebugView ,它什么都不显示。



我确信它在一些VS项目前有效 - 输出包含Debug消息。我们还有一个项目,我们定期使用DebugView工具调试生产,并显示所有Trace.WriteLine消息。



然而,我刚刚发现目前在我的Visual Studio,Console.WriteLine现在写入VS输出窗口,而Trace和Debug.WriteLine没有。



如何控制调试跟踪和控制台的重定向Visual Studio中的输出?

解决方案

如果选择调试,则跟踪,调试和控制台将转到输出窗口从下拉菜单中选择显示输出并选择程序输出选项(在输出窗口中右键单击)。



AFAIK控制台仅重定向到非控制台应用程序的输出。检查项目属性,并确保它在输出类型下拉列表中显示类库或Windows应用程序。


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?

解决方案

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.

这篇关于Visual Studio 2008:如何将Trace,Debug和Console输出重定向到Output窗口?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆