Alex Rivera | Logout

How to use Console.WriteLine in ASP.Net MVC 3

Asked 2012-07-26T11:42:36.060
51

I want to Use Console.writeline in my Asp.net MVC 3 Project. i don't know how to do it. i also try using System.Diagnostics.Debug.WriteLine() method but it also doesn't work. can any one suggest a solution for this

Edit
Report

1 Answer

102
 Debug.WriteLine("My debug string here");

should do the trick. Check that your application is in debug not release:

debug button

If nothing is coming out on your debug window, right click your project. Select properties. On the left of the opened tab, click Build. There is a check-box "Define DEBUG constant", make sure it is clicked.

enter image description here

You most likely know how to set the debug information to show in the output window (Debug->Windows->Output):

enter image description here

answered 2013-06-18T17:35:33.430

Your Answer