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

后端 未结 6 1974
耶瑟儿~
耶瑟儿~ 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:28

    The Trace.WriteLine method is a conditionally compiled method. That means that it will only be executed if the TRACE constant is defined when the code is compiled. By default in Visual Studio, TRACE is only defined in DEBUG mode.

    Right Click on the Project and Select Properties. Go to the Compile tab. Select Release mode and add TRACE to the defined preprocessor constants. That should fix the issue for you.

提交回复
热议问题