Raider throws error when accesing Windows Registry

Same case working with VS 2013.

We try to acces windows registry from our ASP.NET MVC application, but as it is a 64-bit machine there is no way to access the key, getting a null object or reference exception:

RegistryKey regKey = Registry.LocalMachine;
regKey = regKey.OpenSubKey(K_REGEDIT_SubKey);

There is also no way to access using 64-bit registry methods as explained here:

Using OpenSubKey not finding node that exists

The only way to get it working is to add the full registry path including "WOW6432Node" in the subkey search:

HKEY_LOCAL_MACHINE\\SOFTWARE\\WOW6432Node\\MyNewKeyName

 

Please sign in to leave a comment.