I have a windows service that attempt to write to a registry key in LOCAL_MACHINE
The key is created as part of a windows installer package the controls the windows
RegistryKey.OpenSubKey(string) does not open the key for writing. Try using the OpenSubKey(string, bool) overload to specify that you want the key to be writable.
RegistryKey.OpenSubKey(string)
OpenSubKey(string, bool)