locked
performance counters stop working after a few minutes

    Question

  • I have code that periodically logs the values of a list of performance monitor some monitors work just fine the life of the software but ALL .NET CLR Memory and .NET CLR Exceptions stop working after a few minutes of the software running.The error is below, I traced the code and found that the actual name of the software is no longer in the category so it cant see itself anymore. If I open perfmon while the software is running I can always find them. Everything if found about the error is always talking about custom counters this is not.

    The software runs perfectly on xp BUT I need to get it working on windows 7 embedded.

    Error      MainForm           
    OnThreadException: Uncaught WinForms exception thrown:  System
    System.InvalidOperationException: The Counter layout for the Category specified is invalid, a counter of the type:  AverageCount64, AverageTimer32, CounterMultiTimer, CounterMultiTimerInverse, CounterMultiTimer100Ns, CounterMultiTimer100NsInverse, RawFraction, or SampleFraction has to be immediately followed by any of the base counter types: AverageBase, CounterMultiBase, RawBase or SampleBase.
       at System.Diagnostics.CategorySample.GetCounterDefinitionSample(String counter)
       at System.Diagnostics.PerformanceCounter.NextSample()
       at System.Diagnostics.PerformanceCounter.NextValue()

    • Moved by Mike FengModerator Thursday, November 29, 2012 10:51 AM (From:.NET Base Class Library)
    Wednesday, November 28, 2012 5:48 PM

All replies