[英]Debug.Writeline is Not printing anything
VS 2010 Pro, C#, WinForms: at the very beginning of my method I am saying Debug.Writeline("entering method blah");
VS 2010 Pro,C#,WinForms:在我的方法的最开始,我说的是
Debug.Writeline("entering method blah");
then somewhere inside this method I am putting some breakpoints and run the program. 然后我在这个方法的某个地方放置一些断点并运行程序。 so I see that execution is stopped at those break points, so it is here!
所以我看到执行在那些断点处停止了,所以就在这里! but if I search the Output->Debug combobox mode and also Immediate window I cannot find the message I has written for
Debug.Writeline
anywhere. 但如果我搜索Output-> Debug组合框模式以及立即窗口我找不到我为
Debug.Writeline
写的消息。
I also tried that heck box setting in Debug options that says "Redirect all output to Immediate window"....did not help either. 我还尝试在调试选项中设置“将所有输出重定向到立即窗口”的heck框设置....也没有帮助。
Discussed already in the comments, but I wasn't sure until discussing it there. 在评论中已经讨论过,但直到那里讨论它我才确定。 However:
然而:
Debug.Whatever(...)
are typically marked with [Conditional("DEBUG")]
, meaning they require the DEBUG
symbol to be defined, otherwise those calls are not compiled Debug.Whatever(...)
通常用[Conditional("DEBUG")]
标记,这意味着它们需要定义DEBUG
符号,否则这些调用不会被编译 DEBUG
and TRACE
defined for the "Debug" profile, and TRACE
for the "Release" profile DEBUG
和TRACE
,为“Release”配置文件定义了TRACE
DEBUG
symbol via a checkbox in "project properties" DEBUG
符号 So; 所以; go to project-properties, and ensure the
DEBUG
symbol is defined (or not) as appropriate for your needs (for any-and-all profiles that exist in your project). 转到项目属性,并确保根据您的需要定义(或不定义)
DEBUG
符号(对于项目中存在的任何和所有配置文件)。
如果Debug没有打印任何东西(并且你不能断点):你还必须检查项目属性中的“TRACE”。
If there is still no output after all, check the message types that are enabled for the output window: 如果仍然没有输出,请检查为输出窗口启用的消息类型:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.