using Microsoft.Win32;
...
string keyname = "HKEY_LOCAL_MACHINE\\Software\\[REST_OF_PATH]
string value = "ServiceAddress";
string default = "";
string stringValue = (string)Registry.GetValue(keyname, value, default);
On my x64 machine, this works fine (on my x64 machine) when I build with x64 or AnyCPU, but stringValue
is null
when built with an x86 configuration.
I get similar results when I call Registry.LocalMachine.OpenSubKey
Is it possible to get this to work with an x86 build?