3

I am trying to debug my asp.net application and have been stuck on this for too long. I want to output a simple "TEST" for testing.

I have tried:

Console.WriteLine("TEST");
System.Diagnostics.Debug.WriteLine("TEST");
Console.Write("TEST");

I am looking in the output window. What am I missing?

Nathan Baulch
  • 20,233
  • 5
  • 52
  • 56
James
  • 2,951
  • 8
  • 41
  • 55
  • 1
    You are writing to the console. Are you looking at the Output window below project explorer? Also, since it's a web app, I would prefer to test to see if I can get output onto a web browser. –  May 24 '12 at 19:19
  • 1
    Are you in debug mode? Otherwise the second line won't output anything. The others are due to not being a console app. – banging May 24 '12 at 19:27
  • If you're working with a Web application, there is no need to write to a console window. – IrishChieftain May 24 '12 at 19:28

1 Answers1

2

You're running this code in a web app, which doesn't have a console. Use Trace.WriteLine, and configure it correctly. See this answer, for example.

Community
  • 1
  • 1
Roger Lipscombe
  • 89,048
  • 55
  • 235
  • 380