0

How can I trace from the client side of a ASP.NET web application ? I'm trapped in a aspx.cs file and I really need some fast simple debugging. I tried System.Diagnostics.Trace.WriteLine without success: nothing appeared in DebugViewer when I refreshed the page in browser.

Thanks!

Edit: Adding the Trace attribute to the page Directive in my aspx file did trace Trace.Write, but I don't want all the other bulk trace (some hundred lines)

Edit 2: I'm not using Visual Studio and I don't want it if only for tracing.

Aliaksandr Sushkevich
  • 11,550
  • 7
  • 37
  • 44
Liviu
  • 1,859
  • 2
  • 22
  • 48

1 Answers1

1

You have a couple of options

Here's a link to the MSDN article How to: Enable Tracing for an ASP.NET Application

You can view trace info by going to http://localhost:<portnumber>/trace.axd

If you're using Visual Studio you can use:

System.Diagnostics.Debug.WriteLine("This appears in the output window!")
zeroef
  • 1,949
  • 23
  • 32
  • The first link worked as I wanted (DebugView) by adding in web.config: ` ` But there's still a problem - how can I get rid of the "aspx.page" log entries: `[8404] aspx.page: Begin PreInit [8404] aspx.page: End PreInit [8404] aspx.page: Begin Init [8404] aspx.page: End Init ` – Liviu Jun 27 '13 at 23:14
  • I'm not sure that you can. You can use `Trace.warn` instead of write and they will show up as red instead of black to stand out a little better. – zeroef Jun 27 '13 at 23:19
  • Thank you, I will give it to you in a few days if it is as good as it gets. – Liviu Jun 28 '13 at 01:15