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?
To open the Output window, on the menu bar, choose View > Output, or press Ctrl+Alt+O.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With