MVC App pointing to wrong hive(Registry)

49 views Asked by At

In my MVC app i have the following code:

Private ipConecta As String = My.Computer.Registry.GetValue(
"HKEY_CURRENT_USER\Software\SPR4", "ConnString", Nothing)

But looking in the Process monitor, i see that is pointing to another hive:

enter image description here

How can i make it pointing to read the registry on HKEY_CURRENT_USER\Software\SPR4

1

There are 1 answers

0
Hackerman On BEST ANSWER

Finally, i resolve my issue, pointing to HKEY_LOCAL_MACHINE:

Private reg As RegistryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\SPR4")

And giving permissions on that key to the user IUSR.