Display a message in Visual Studio's output window when not debug mode?

后端 未结 6 1956
耶瑟儿~
耶瑟儿~ 2021-01-31 13:50

In Java, you can use System.out.println(message) to print a message to the output window.

What\'s the equivalent in Visual Studio ?

I know when I\'m

6条回答
  •  执笔经年
    2021-01-31 14:25

    This whole thread confused the h#$l out of me until I realized you have to be running the debugger to see ANY trace or debug output. I needed a debug output (outside of the debugger) because my WebApp runs fine when I debug it but not when the debugger isn't running (SqlDataSource is instantiated correctly when running through the debugger).

    Just because debug output can be seen when you're running in release mode doesn't mean you'll see anything if you're not running the debugger. Careful reading of Writing to output window of Visual Studio? gave me DebugView as an alternative. Extremely useful!

    Hopefully this helps anyone else confused by this.

提交回复
热议问题