I get a null back from this attempt to access the Windows Registry:
using (RegistryKey registry = Registry.LocalMachine.OpenSubKey(keyPath))
keyPath is SOFTWARE\\TestKey
The key is in the registry, so I do not know why it's not finding it under Local Machine hive.