Writing to output window of Visual Studio

前端 未结 13 1764
忘了有多久
忘了有多久 2020-11-28 17:56

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

13条回答
  •  臣服心动
    2020-11-28 18:21

    For debugging purposes, the System.Diagnostics.Debug.WriteLine() command will not be compiled into the release version of your code unless you have debug listeners. It writes to all trace listeners which includes the VS output window when running in Debug mode.

    For a Console application. Console.WriteLine() would work but the output would still be generated in the release version of your binary.

    Debug output should also appear in the normal output window when debugging tests; whereas, console.writeline output does not (but can be found in the test output window.)

提交回复
热议问题