25 Jun 2016 10:00:00.5727|Error|Monitoring|||Execute|registry entry has the wrong value in the System.Diagnostics.PerformanceCounterLib.RegisterFiles(String arg0, Boolean unregister)
in System.Diagnostics.PerformanceCounterLib.UnregisterCategory(String categoryName)
in System.Diagnostics.PerformanceCounterCategory.Delete(String categoryName)
in PerformanceMonitor.PerformanceCategory.DeleteIfExists()
in PerformanceMonitor.MonitoringDispatcher.Initialize(Boolean recreateExistingCategories)
in CustomServer.Threads.Monitoring.Execute()
_
public bool DeleteIfExists()
{
if (PerformanceCounterCategory.Exists(Name))
{
PerformanceCounterCategory.Delete(Name);
return true;
}
return false;
}
public bool CreateIfNotExists()
{
if (!PerformanceCounterCategory.Exists(Name))
{
var counters = new CounterCreationDataCollection();
foreach (PerformanceSet set in this.counterSets)
{
foreach (CounterCreationDataExt creationData in set.CounterCreationData)
{
counters.Add(creationData);
}
}
PerformanceCounterCategory.Create(Name, Description, CategoryType, counters);
return true;
}
return false;
}
Find more questions by tags .NETC#Performance evaluationProgrammingWindows