Here’s my registry writing code
key.SetValue(KeyName, KeyValue_number, RegistryValueKind.DWord);
When debugging the values are like this:
key = {HKEY_LOCAL_MACHINE\SOFTWARE\Test}
KeyName = "quack"
KeyValue_number = 1
So it seems like it should be inserting fine but i can’t find the key in the registry at all :/, not as a directory or key
restarted regedit and everything, still nothing, it’s confusing
Turns out that on a 64 bit system, windows automatically redirects a lot of keys to a different folder within the registry.
In my case it was “HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Test”.
EDIT: Thanks to Hans Passant below, apparently the way to fix this is to simply set your compiling platform to “Any CPU” and this problem is resolved