vb.net Visual Studio 输出窗口不显示 Debug.Write() 发送的消息
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/5128936/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Visual Studio output window is not displaying messages sent by Debug.Write()
提问by Mike Moyle
I am using Visual Studio 2010 Professional in trial mode... and suddenly the Output window won't show my Debug.Write()stuff. It had been showing it for the past month.
我在试用模式下使用 Visual Studio 2010 Professional...突然输出窗口不会显示我的Debug.Write()内容。在过去的一个月里它一直在展示它。
I have been using the 2010 version for 30 days (after upgrading from Visual Studio 2003) in trial mode. I just renewed the trial for the extra 60 days, and the "About Visual Studio" window says I still have 59 days left.
我已经在试用模式下使用 2010 版本 30 天(从 Visual Studio 2003 升级后)。我刚刚将试用期延长了 60 天,“关于 Visual Studio”窗口显示我还有 59 天的时间。
I have verified that the application is running properly, without errors. When I purposely generate an error, the Output Window properly shows the error and the stack trace I've already checked my Build>Configuration... it's in "Debug" mode, not "Release". The Debug.Write()
text is not going to the Immediate window, either.
我已经验证应用程序运行正常,没有错误。当我故意生成错误时,输出窗口会正确显示错误和堆栈跟踪,我已经检查过我的构建>配置......它处于“调试”模式,而不是“发布”模式。该Debug.Write()
文本是不会立即窗口,无论是。
One other point, I tried running the same application in the Visual Studio 2010 Express Edition, and it complained that it could not debug the specified code, though it did properly build it so that it would run in the build. Could Visual Studio 2010 Express have modified something in my project files to disable the debugging output? I looked, but I really don't know what to look for.
另外一点,我尝试在Visual Studio 2010 Express Edition 中运行相同的应用程序,但它抱怨无法调试指定的代码,尽管它确实正确构建了它,以便它可以在构建中运行。Visual Studio 2010 Express 是否可以修改我的项目文件中的某些内容以禁用调试输出?我看了,但我真的不知道该找什么。
回答by kemida
Same symptoms for me, different solution:
对我来说相同的症状,不同的解决方案:
- Tools -> Options -> Debugging -> General
- Uncheck "Redirect all Output Window text to the Immediate Window"
- 工具 -> 选项 -> 调试 -> 常规
- 取消选中“将所有输出窗口文本重定向到立即窗口”
After I did that, debug.print() went to the Output Window like it used to.
在我这样做之后, debug.print() 像以前一样进入输出窗口。
Weird that I never checked that option to begin with. Something I did must have caused the setting to change. No idea.
奇怪的是,我从未检查过该选项。我所做的某些事情一定会导致设置发生变化。不知道。
回答by Chad Miller
There could be another reason the debug information is not showing in the Output window or the Immediate window. If your config file removes the default listener the debug information will not show. Comment out the remove default in the listeners section in your app.config file:
调试信息未显示在“输出”窗口或“立即”窗口中可能还有另一个原因。如果您的配置文件删除了默认侦听器,则不会显示调试信息。注释掉 app.config 文件中 listeners 部分中的删除默认值:
<trace autoflush="true" indentsize="4">
<listeners>
<!--<remove name="Default" />-->
</listeners>
</trace>
回答by Joel DEROCHE
Just an update regarding this issue I have as well because I change the filter setuptin the output windows. You need to right click in the Output window then select "PROGRAM OUTPUT" if it's not already selected.
我也有关于这个问题的更新,因为我更改了输出窗口的过滤器设置。如果尚未选择“程序输出”,则需要在“输出”窗口中单击鼠标右键,然后选择“程序输出”。
Screenshot of the context menu on right click in the output window
在输出窗口中右键单击上下文菜单的屏幕截图
回答by Julio Casal
Please take a look at this other question, which presents several possible reasons for your issue: Where does System.Diagnostics.Debug.Write output appear?
请查看另一个问题,其中提供了导致您的问题的几个可能原因:System.Diagnostics.Debug.Write 输出出现在哪里?
I would start by checking the DEBUG flag.
我将首先检查 DEBUG 标志。