I would like to print some traces during the requests processing.
But when I make Console.WriteLine("something") in this environment, nothing is shown.
What is missing, what do I need to do in order to use console to print these traces?
Thanks
I would like to print some traces during the requests processing.
But when I make Console.WriteLine("something") in this environment, nothing is shown.
What is missing, what do I need to do in order to use console to print these traces?
Thanks
Where are you looking for the output?
Console.WriteLine() writes to the command line - not to the webpage. Either use Response.Write() to write onto the webpage or start up your application in the Visual Studio debugger to look at the command line output.
You can use Response.Write to write output to your page for debugging, or use alert in javascript, or even write to a log file. There are many ways to get debugging output. There's also a log4net for .Net that you can use (similar to log4j)
Use Debug.Write()
and use the debugger output window.
Alternatively, use the ASP.NET trace feature, which is quite powerful.
Given that it's an ASP.NET application, I would do:
Page.Trace.Write ("Something here");
Then enable trace either for the page or the application and then just go to ~/Trace.axd to see the results (they can also be at the end of the page output, depending on the configuration option that you choose).