I have an old, and small application with ~250 lines of code. The .NET framework is 2.0. I want to upgrade to newest .NET framework. Since the app is so small, I thought I will create a new app with the same name, select latest framework, and copied & pasted the code from old app to new with .NET Framework 4.5

The problem is that opening a registry key returns "Nothing"
Code:
        Dim SoftwareKey As String = "SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products"

        Using rk As RegistryKey = Registry.LocalMachine.OpenSubKey(SoftwareKey)
The exact same code runs fine in the old app with .NET Framework 2.0, but this returns "Nothing" in the new app with .NET Framework 4.5 selected.

Why something so simple is not working?