[英]Writing messages with Debug.Write in VS2012?
I am using the following in my C# code: 我在我的C#代码中使用以下内容:
System.Diagnostics.Debug.Write("xxx");
But when I look in the output window I cannot see anything even though my code does execute this line. 但是当我查看输出窗口时,即使我的代码执行此行,我也看不到任何内容。
Is this the correct way to write messages that I can see in the VS2012? 这是编写我在VS2012中可以看到的消息的正确方法吗?
Debug.Write
will only function if the DEBUG
build flag is set. DEBUG
构建标志, Debug.Write
才会起作用。 OR 要么
Debug.Write
calls may not display in the output window if you have the Visual Studio option "Redirect all Output Window text to the Immediate Window" checked under the menu Debug.Write
调用可能不会显示在输出窗口中 Tools > Options > Debugging > General.
工具>选项>调试>常规。
To display "Tools > Options > Debugging"
, check the box next to "Tools > Options > Show All Settings". 要显示
"Tools > Options > Debugging"
,请选中“工具>选项>显示所有设置”旁边的框。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.