問題:
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("")
. 我搜索了像Java的system.out.println("")
這樣的函數。 I tried Debug.Write
, Console.Write
, and Trace.Write
. 我試過Debug.Write
, Console.Write
和Trace.Write
。 It does not give an error, but it does not print anything either. 它不會出錯,但也不會打印任何內容。 ide
"Define DEBUG constant" and "Define TRACE constant" options are checked. 選中「定義DEBUG常量」和「定義TRACE常量」選項。 函數
Menu Tools → Options → Debugging → "Redirect all Output Window text to the Immediate Window" option is not checked. 菜單工具 → 選項 → 調試 → 「將全部輸出窗口文本重定向到當即窗口」選項未選中。 工具
Configuration: Active (Debug) 配置:活動(調試) url
Note: I created a project with the wizard as "Windows Forms Application" if relevant. 注意:若是相關,我建立了一個項目,嚮導爲「Windows窗體應用程序」。 I have no idea where to look. 我不知道在哪裏看。 idea
解決方案:
參考一: https://stackoom.com/question/dikw/寫入Visual-Studio的輸出窗口參考二: https://oldbug.net/q/dikw/Writing-to-output-window-of-Visual-Studio