How to make DebugView see my program
-
Does anyone know how to make DebugView from SysInternals "work"? I am trying to write a C# program in .NET 2003 and to print 2 lines:
System.Diagnostics.Debug.WriteLine("I am debugging");
System.Diagnostics.Trace.WriteLine("I am Tracing");I start dbgview.exe, run my program, and I do not see those comments (I checked that I am in debug mode). I have seen references to some kind of TraceListener, but I don't know what that is or where to set it up. If anyone knows what I'm talking about, could you please link me to some pertinent info? My quick search on google didn't give me anything. Thanks Sue
-
Does anyone know how to make DebugView from SysInternals "work"? I am trying to write a C# program in .NET 2003 and to print 2 lines:
System.Diagnostics.Debug.WriteLine("I am debugging");
System.Diagnostics.Trace.WriteLine("I am Tracing");I start dbgview.exe, run my program, and I do not see those comments (I checked that I am in debug mode). I have seen references to some kind of TraceListener, but I don't know what that is or where to set it up. If anyone knows what I'm talking about, could you please link me to some pertinent info? My quick search on google didn't give me anything. Thanks Sue
You can add a trace listener using your app.config file look here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrflistenerselement.asp[^]
I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
-
Does anyone know how to make DebugView from SysInternals "work"? I am trying to write a C# program in .NET 2003 and to print 2 lines:
System.Diagnostics.Debug.WriteLine("I am debugging");
System.Diagnostics.Trace.WriteLine("I am Tracing");I start dbgview.exe, run my program, and I do not see those comments (I checked that I am in debug mode). I have seen references to some kind of TraceListener, but I don't know what that is or where to set it up. If anyone knows what I'm talking about, could you please link me to some pertinent info? My quick search on google didn't give me anything. Thanks Sue
That's surprising. AFAIK, TraceListeners are useful if you want to monitor trace output within your application, they notify you when someone does a Trace.WriteLine or something similar. You should be seeing the messages in DebugView without doing anything special. Are you able to see the messages in VS .NET's Output window? Regards Senthil _____________________________ My Blog | My Articles | WinMacro
-
You can add a trace listener using your app.config file look here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrflistenerselement.asp[^]
I can imagine the sinking feeling one would have after ordering my book, only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
Thanks very much for the link. I can't seem to get it working yet, but I will keep looking around here. I put in a TextWriterTraceListener, and that does nothing; I put in an EventLogTraceListener, and that properly writes to the Event Log; I put in a DefaultTraceListener, and that throws an error. Thanks for the help. Sue
-
That's surprising. AFAIK, TraceListeners are useful if you want to monitor trace output within your application, they notify you when someone does a Trace.WriteLine or something similar. You should be seeing the messages in DebugView without doing anything special. Are you able to see the messages in VS .NET's Output window? Regards Senthil _____________________________ My Blog | My Articles | WinMacro
I did not realize I could see the output there :-O. I fired it up, and yes, I can see the output in the output window. I still cannot see it in DebugView though! I tried the suggestion from the other poster to add a trace listener app.config section but that didn't seem to work. I can get a lot of information, though, just by using the output window. Man, I feel like an amateur!