Blog Home  Home Feed your aggregator (RSS 2.0)  
What did you learn today? - 70-551, 70-552, 70-553 Section I, Part III - Diagnostics
Phil Denoncourt's Technology Rants
 
 Tuesday, January 31, 2006

UPGRADE: MCAD Skills to MCPD Web Developer by Using the Microsoft .NET Framework
UPGRADE: MCAD Skills to MCPD Windows Developer by Using the Microsoft .NET Framework
UPGRADE: MCSD Microsoft .NET Skills to MCPD Enterprise Application Developer by Using the Microsoft .NET Framework: Part 1

Debug and trace a .NET Framework application by using the System.Diagnostics namespace.

  • Debug class and Debugger class
  • Trace class, CorrelationManager class, TraceListener class, TraceSource class, TraceSwitch class, XmlWriterTraceListener class, DelimitedListTraceListener class, and EventlogTraceListener class
  • Debugger attributes

Krzysztof Cwaline has a good writeup of these features on MSDN.

Debug class - Pretty much the same as it was before.  Debug.Assert, Debug.WriteLine.... However they did add a Debug.Print which appears functionally identical to Debug.WriteLine.  Maybe it makes VB 6.0 upgrades easier.

Debugger class - Nothing new here, either.  Embodies the debugger – is a process attached, break into a debugger, launch a debugger.

Trace class - There are some new methods here.  My impression is that they added some of the stuff from the Enterprise Instrumentation Framework.  TraceError, TraceWarning, CorrelationManager, UseGlobalLock are some of the new members. 

CorrelationManager - Denny Mitch has a excellent writeup on this class (It's written for the beta release, but the information still applies).  The idea is to provide some way to differentiate tracing information when more then one request could be executing at the same time or to get some context when you are calling a method recursively.

TraceListener - Abtract class that serves as the base for all TraceListeners.  It appears you can now control the "verbosity" of the trace output with the TraceOutputOptions property.  You can also filter what gets send to a listener using the filter property.  Denny Mitch has another great post about that feature.

TraceSource - Abtract class that serves as the base for all TraceSources.  They've added three new TraceSources in 2.0: ConsoleTraceListener, DelimitedListTraceListener and XmlWriterTraceListener.  Again, Denny Mitch has some good stuff on them.

TraceSwitch - An object that limits what events get reported to a trace listener.  Another method of filtering.  This allows you to control what level of messages the TraceSource is interested in.  Tradionally specified in your app's config file.

There is a good MSDN mag article by John Robbins that discusses the details of the new tracing features.

Debugger Attributes - This task was vague to me.  I took it to mean:  understand all the attributes in the System.Diagnostics namespace.  There is a good article on MSDN about these attributes.

            DebuggerDisplayAttibute tells which field/property should be shown in the watch window for a class.

 

            DebuggerTypeProxyAttribute  tells debugger to use a different class when representing it in the debug window.  Recommended practice is that the TypeProxy is an internal class of the intended class.  TypeProxy must contain a constructor with the intended class as a parameter.

 

            DebuggerBrowseableAttribute specifies if/how a member is displayed in the debug window : Never (Hidden), Collapsed (Displayed when expanded – default), RootHidden – Display members of the collection, not the collection properties if collection class.

Next post - Runtime Serialization

Tuesday, January 31, 2006 2:53:11 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]   Certifications  | 
Comments are closed.
Copyright © 2010 Phil Denoncourt III. All rights reserved.
DasBlog 'Portal' theme by Johnny Hughes.
Pick a theme: