Home All Groups Group Topic Archive Search About

Re: .Net 2.0, PerformanceCounter.NextValue() exceptions

Author
6 Feb 2007 6:33 PM
Joe K
To see whether the issue was somehow related to the underlying state of the
PerformanceCounter object, I caught the three exceptions and:
1) closed the existing PerformanceCounter object
2) created a new PerformanceCounter object
3) called NextValue() again

Even with a new object, the calls to NextValue still regularly fails with
the same exceptions.  This suggests the bug is not within
PerformanceCounter, but within some shared state it uses.

I started looking at an internal .Net 2.0 class called PerformanceCounterLib
that appears to manage the underlying resources for perf counters on a per
machine basis.  It's not clear to me the lifetime of a PerformanceCounterLib
or under what scenarios these objects are explicitly closed - but I have a
wild suspicion that somehow this is related to my problem.

Any help or advice is appreciated.  I'm stuck.

Joe

AddThis Social Bookmark Button