I’ve created some values in Windows Registry and try to access them from .NET but there is an error.
Registry.LocalMachine.OpenSubKey(“SOFTWARE”).OpenSubKey(“ZvezdnyShop”) is null, however there is an such key in Registry
REGEDIT http://astzvezdny.newsujet.com/REGEDIT.jpg
ERROR IN VS http://astzvezdny.newsujet.com/VS.jpg
What’s the matter?
ANSWER
My Application was 32bit, so I need place ZvezdnyShop at HKLM/Software/Wow6432Node
Thanks to Frédéric Hamidi
The
ZvezdnyShopkey in your screenshot resides in the 64-bit portion of the registry, so it will only be visible to 64-bit applications.Therefore, if your project targets the
x86platform, the 32-bit application it produces won’t see that key.To fix that problem, you can create the key in the 32-bit portion of the registry, i.e.
HKLM\SOFTWARE\Wow6432Node\ZvezdnyShop, or have your project target thex64platform.