Fixing the Performance Counter Registry Error
Problem
When starting the Piccadilly service you may receive an error like this:
Service cannot be started.
System.InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.
at System.Diagnostics.PerformanceCounterLib.GetStringTable(Boolean isHelp)
at System.Diagnostics.PerformanceCounterLib.get_NameTable()
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.CategoryExists(String machine, String category)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName, String machineName)
at System.Diagnostics.PerformanceCounterCategory.Exists(String categoryName)
at Witness.Framework.Core.Common.TaskQueueThreadPerformanceCounters.iIj6gBM0rfUkpmUp9V8(Object)
at Witness.Framework.Core.Common.TaskQueueThreadPerformanceCounters..ctor(String category, String instance)
at Witness.Framework.Core.Common.TaskQueueThread`1.Start()
at Witness.Framework.Common.Navtech.Logging.DhiYXbWHt6ILqkVFVfO(Object )
at Witness.Framework.Common.Navtech.Logging..ctor(Strin...
This error occurs when one of the performance counter registrations used by Witness has become corrupt. These performance counters are stored in the registry and in certain situations can be corrupted. Its not clear why this happens, but it is a recognised error state and Microsoft have a documented fix. Further information can be found here: https://support.microsoft.com/en-us/kb/300956.
Solution
To resolve the problem, you need to run a command, either directly or through Windows command prompt:
Esnure you have logged onto the PC as an administrator.
Open a Windows Command prompt or, assuming your version of WIndows supports it, open the Run dialog.
Enter the following command: lodctr.exe /r
Select return.