Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Console output from web applications in Visual Studio

Tags:

How do you debug web applications written in C# in Visual Studio? I'm using Console.WriteLine expecting the text to appear in the Output tab. Like it does when you develop console applications. But for web applications, the console output doesn't show up anywhere.

like image 691
Björn Lindqvist Avatar asked May 10 '11 11:05

Björn Lindqvist


People also ask

How do I display output in Visual Studio?

To display the Output window whenever you build a project, in the Options dialog box, on the Projects and Solutions > General page, select Show Output window when build starts.

How do I run a console application in Visual Studio?

Build and run your code in Visual Studio To run the code, on the menu bar, choose Debug, Start without debugging. A console window opens and then runs your app. When you start a console app in Visual Studio, it runs your code, then prints "Press any key to continue . . ." to give you a chance to see the output.


2 Answers

Debug.WriteLine

       

like image 97
spender Avatar answered Sep 28 '22 08:09

spender


They are two form to write in Console Output for NET applications.

Debug.WriteLine()  // See [Microsoft Documentation][1]
Trace.WriteLine()  // See [Microsoft][2] documentation for more information

The difference between the two is that Debug only work when the program is in DEBUG mode. In the other hand TRACE works always. You can also set different levels of TRACE. See documentation for more information.

I hope that this information help you.

like image 40
freedeveloper Avatar answered Sep 28 '22 06:09

freedeveloper