Hi I have the following code which works fine in Visual Studio 2008 in a .net 3.5 Win forms Program and returns the correct Registry Key Value
Dim regkey As RegistryKey
Dim LicenseKey As String
regkey = Registry.LocalMachine.OpenSubKey("Software\Laurus Media\Laurus Event Master", True)
LicenseKey = regkey.GetValue("SharedPath", "Error")
but with the same code in Visual Studio 2010 in a .net 4 project I get a "Object reference not set to an instance of an object" Error?? I really dont understand it. Iv tried everything.
If I copy the registry Key to Current User Hive and change the code to point to Current User Hive it works fine.
So .net 4 just doesn't want to read from Local Machine Hive
View Complete Post