System.InvalidOperationException : The Counter layout for the Category
specified is invalid, a counter of the type: AverageCount64,
AverageTimer32, CounterMultiTimer, CounterMultiTimerInverse,
CounterMultiTimer100Ns, CounterMultiTimer100NsInverse, RawFraction,
SampleFraction or SampleCounter has to be immediately followed by any of
the base counter types : AverageBase, MultiBase, RawBase or SampleBase.
at
System.Diagnostics.CategorySample.GetCounterDefinitionSample(String
counter)
at System.Diagnostics.PerformanceCounter.NextSample()
at System.Diagnostics.PerformanceCounter.NextValue()
When I get this exception from a specific server, .Net will no longer
collect data from it until the application is restarted. My only guess is
that there is some caching of resources done in .Net that do not get freed
when I call PerformanceCounter.Close(). The server in question is a SQL
Server cluster that has failed over.
My next step is to try to global static method
PerformanceCounter.CloseSharedResources(). I should know shortly if this
makes the problem go away. While I hope it does, it is still not an ideal
solution since: 1) there is no documentation of what CloseSharedResources()
does and does not do, 2) at the time I make this call, my application can
have up to 25 threads fetching performance counter data (and I really want
to free resources for one server - not up to 25).
Any thoughts/advice would be appreciated.
Joe
Kevin Dwyer
"Joe" <j...@nospamplease.com> wrote in message
news:O8KZwnu8...@TK2MSFTNGP10.phx.gbl...
Any ideas?
Joe