20

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.

Björn Lindqvist
  • 19,221
  • 20
  • 87
  • 122
  • 1
    This will be shown in browser's console. Install FireBug in FF and you can see the console output. You can also see the console output in Safari and Chrome in their buit-in error console. – fardjad May 10 '11 at 11:56
  • 2
    Check out this question; http://stackoverflow.com/questions/137660/where-does-console-writeline-go-in-asp-net – Chris McAtackney May 10 '11 at 11:57
  • @fardjad: Console.WriteLine shows up in browser's console? Really? – spender May 10 '11 at 11:58
  • @spender: I thought Console.WriteLine is similar to console.log in javascript. I'm sorry for my mistake. – fardjad May 10 '11 at 12:05

2 Answers2

26
Debug.WriteLine

       

spender
  • 117,338
  • 33
  • 229
  • 351
2

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.

freedeveloper
  • 3,670
  • 34
  • 39