D
Dan Holmes
I am trying to write to the HKLM hive from a service. I can read from it just fine. I have what i believe to be the
correct code but i am getting access violations.
RouteMatch.CM.ProtocolTestHarness.SetRegistryKey:
System.UnauthorizedAccessException: Cannot write to the registry key.
at System.ThrowHelper.ThrowUnauthorizedAccessException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.EnsureWriteable()
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
at RouteMatch.CM.RMCMService.SetRegistryValue(String message) in C:\Sandbox\DM71740 - Client
Managment\src\RMCMS\RMCM.cs:line 192
at RouteMatch.CM.RMCMService.ProcessMessage(Object clientState) in C:\Sandbox\DM71740 - Client
Managment\src\RMCMS\RMCM.cs:line 118
Expected: 0
But was: -99
My service is logged in a the local administrator and Permissions for that key for the local Admin are Full Control. I
don't know what to check or how to debug this further. I can step into the code and follow the throw at .SetValue but i
don't know what else to try. What else can i try?
thanks
danny
correct code but i am getting access violations.
RouteMatch.CM.ProtocolTestHarness.SetRegistryKey:
System.UnauthorizedAccessException: Cannot write to the registry key.
at System.ThrowHelper.ThrowUnauthorizedAccessException(ExceptionResource resource)
at Microsoft.Win32.RegistryKey.EnsureWriteable()
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value, RegistryValueKind valueKind)
at Microsoft.Win32.RegistryKey.SetValue(String name, Object value)
at RouteMatch.CM.RMCMService.SetRegistryValue(String message) in C:\Sandbox\DM71740 - Client
Managment\src\RMCMS\RMCM.cs:line 192
at RouteMatch.CM.RMCMService.ProcessMessage(Object clientState) in C:\Sandbox\DM71740 - Client
Managment\src\RMCMS\RMCM.cs:line 118
Expected: 0
But was: -99
My service is logged in a the local administrator and Permissions for that key for the local Admin are Full Control. I
don't know what to check or how to debug this further. I can step into the code and follow the throw at .SetValue but i
don't know what else to try. What else can i try?
thanks
danny