Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 in debug mode I can use this to see the message in the output window:

Debug.WriteLine("Debug : User_Id = "+Session["User_Id"]); System.Diagnostics.Trace.WriteLine("Debug : User_Id = "+Session["User_Id"]); 

How can this be done without debugging in Visual Studio?

like image 806
Frank Avatar asked Feb 18 '09 20:02

Frank


People also ask

How do I get the output in output window in Visual Studio code?

To open the Output window, on the menu bar, choose View > Output, or press Ctrl+Alt+O.

How do I run Visual Studio code without debugging?

Run mode# In addition to debugging a program, VS Code supports running the program. The Debug: Run (Start Without Debugging) action is triggered with Ctrl+F5 and uses the currently selected launch configuration.

How do I fix the Output window in Visual Studio?

To display these options, open the Tools menu, click Options, expand the Debugging node, and click Output Window. General Output Settings This category contains controls that determine whether general debug messages appear in the Output window. You can specify whether each type of message appears.


1 Answers

The results are not in the Output window but in the Test Results Detail (TestResult Pane at the bottom, right click on on Test Results and go to TestResultDetails).

This works with Debug.WriteLine and Console.WriteLine.

like image 186
Jos Avatar answered Oct 02 '22 04:10

Jos