Unhandled Exception: Process performance counters are disabled
Debug Error:
Unhandled exception: System.InvalidOperationException: The process performance counter is disabled, so the requested operation cannot be performed
Problem solving:
Method One:
Just fix the Windows performance counters.
Specific method: In the Run input: lodctr/r then enter, after running, restart the computer.
Method Two:
Modify registry information
Hkey_local_machine/system/currentcontrolset/services/perfproc/performance the following key value disable performance Counters set to 0. Reboot again!
Using C # Programming to implement the "Set Disable performance counters key value is 0"
Using Microsoft.Win32;
private void Button7_click (object sender, System.EventArgs e)
{
RegistryKey HKLM = Registry.localmachine;
RegistryKey software = HKLM. OpenSubKey ("System//currentcontrolset//services//perfproc", true);
RegistryKey mykey= software. OpenSubKey ("Performance", true);
Mykey.setvalue ("Disable performance Counters", 0);
}
Requires the current user to be an administrator on this computer, otherwise there is no permission to modify the registry