本文介绍了写入Visual Studio的输出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将消息写入输出窗口以进行调试.我搜索了Java system.out.println("")之类的函数.我尝试了Debug.WriteConsole.WriteTrace.Write.它不会给出错误,但也不会打印任何内容.

I am trying to write a message to the output window for debugging purposes. I searched for a function like Java's system.out.println(""). I tried Debug.Write, Console.Write, and Trace.Write. It does not give an error, but it does not print anything either.

选中定义调试常量"和定义跟踪常量"选项.

"Define DEBUG constant" and "Define TRACE constant" options are checked.

菜单工具选项调试将所有输出窗口文本重定向到立即窗口" 选项未选中.

Menu ToolsOptionsDebugging"Redirect all Output Window text to the Immediate Window" option is not checked.

配置:活动(调试)

注意:我创建了一个向导,项目为"Windows Forms Application"(如果相关).我不知道在哪里看.

Note: I created a project with the wizard as "Windows Forms Application" if relevant. I have no idea where to look.

推荐答案

添加System.Diagnostics命名空间,然后可以使用Debug.WriteLine()快速将消息打印到IDE的输出窗口.有关更多详细信息,请参阅以下内容:

Add the System.Diagnostics namespace, and then you can use Debug.WriteLine() to quickly print a message to the output window of the IDE. For more details, please refer to these:

这篇关于写入Visual Studio的输出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 12:15