Writing to output window of Visual Studio?

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 Tools → Options → Debugging → "Redirect all Output Window text to the Immediate Window" option is not checked.

Configuration: Active (Debug)

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


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:

  • How to trace and debug in Visual C#
  • A Treatise on Using Debug and Trace classes, including Exception Handling

  • 这将写入调试输出窗口:

    using System.Diagnostics;
    
    Debug.WriteLine("Send to debug output.");
    

    使用:

    System.Diagnostics.Debug.WriteLine("your message here");
    
    链接地址: http://www.djcxy.com/p/24396.html

    上一篇: 安装Visual Studio 2010 sp1错误

    下一篇: 写入Visual Studio的输出窗口?