Customizing the behavior of System.Diagnostics.Debug.Assert [Matt Ellis]

When Inbar posted his refresher on the System.Diagnostics.Debug class, Ron Cain asked an interesting question about Assert in the context of a test harness. Because of this I thought it might be nice to expound on some of the details on exactly how Debug.Assert ends up popping up UI when a failure occurs and what…

4

BCL Refresher: System.Diagnostics.Debug class [Inbar Gazit]

Many people told me that they would like to see more blog entries. Not only about the new cool stuff that’s coming but also about the old established stuff that’s maybe a tad forgotten. So, with the BCL refresher series we’re going to go back to talk about existing APIs that are useful and remind…

7

A new TraceListener in Orcas: EventSchemaTraceListener [Inbar Gazit]

TraceListener is an abstract class representing a listener object that is used to log event that a TraceSource is producing. In .NET 2.0 we have a few existing implementations such as ConsoleTraceListener for logging events to the standard console and TextWriterTraceListener that is used for logging events to a text file. In our new version…

7

Process and ServiceProcess Caching [Robert Villahermosa]

I’ve seen several questions over the last month or two about refreshing the status of certain properties on the Process and ServiceProcess classes.  I’d like to take this opportunity to take a look at an example from both these classes and see how we can resolve these issues. Issue One: Process.MainWindowHandle resturns 0, even though…

5

How to Read Performance Counters Without Administrator Privileges [Ryan Byington]

If you have ever tried to read performance counter data on a Windows 2003 machine as a non admin user you will have likely seen an exception like the following: System.UnauthorizedAccessException: Access to the registry key ‘Global’ is denied.    at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str)    at Microsoft.Win32.RegistryKey.InternalGetValue(String name, Object defaultValue, Boolean doNotExpand, Boolean checkSecurity)…

4

How to Read Performance Counters [Ryan Byington]

In the time that I have owned performance counters I have seen a lot of code that incorrectly uses the PerformanceCounter class to read counter values. This entry seeks to explain the proper way to read counter values using the PerformanceCounter class.   Reading performance counters is not as trivial as you might think. You…

5

A Tracing Primer – Part II (A) [Mike Rousos]

In my introduction to tracing (http://blogs.msdn.com/bclteam/archive/2005/03/15/396431.aspx), I outlined the basics of how to use TraceSources, TraceListeners, and SourceSwitches to trace the flow of an application. I also covered how to configure Whidbey tracing with a configuration file. In this series of three follow-up articles, I plan to discuss the use of TraceFilters, custom listeners, and…

6

New Performance Counter Features [Ryan Byington]

IntroductionBefore going into detail of the changes in v2.0 I think it is important to start off with explaining the existing problems with the performance counter infrastructure. The first problem is the memory reserved for performance counters is fixed, though the initial size of the memory can be changed from a config file. By itself…

3

A Tracing Primer – Part I [Mike Rousos]

One of the changes in Whidbey will be a revamped tracing system. Much is unchanged – tracing messages are sent through switches to listeners where the data is reported in some fashion. One of the main differences is the inclusion of the TraceSource type. This type will function as the main tracing entity, as opposed…

25