Windows 7 – C# Registry.GetValue is always returning null


This is some problem with 64-Bit OS.

the actual answer:

http://stackoverflow.com/questions/869783/windows-64-bit-registry-v-s-32-bit-registry

since my laptop is 64bit and my app is 32bit… it was looking under

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\CompanyX

Advertisements

One thought on “Windows 7 – C# Registry.GetValue is always returning null

  1. I’ve no idea why but i solved using
    My.Computer.Registry.CurrentUser.GetValue(“Software\Mykey”,”Default Value”)
    instead of
    My.Computer.Registry.GetValue(“HKEY_CURRENT_USER\Software”,”Mykey”,”Default Value”)

    If the key doesn’t exist the first example returns “Default Value”, the second a null object!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s