Disclaimer The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
UPGRADE: MCAD Skills to MCPD Web Developer by Using the Microsoft .NET FrameworkUPGRADE: MCAD Skills to MCPD Windows Developer by Using the Microsoft .NET FrameworkUPGRADE: 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.
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