7
Answers

Unable to open registry subkey On windows 10 PC using C#

Sujeet Suman

Sujeet Suman

7y
328
1
I unable to open programmatically registry subkey on windows 10 PC.
 
I am getting exception by using below code.
 

using (RegistryKey keys = Registry.LocalMachine.OpenSubKey(a_Path,      RegistryKeyPermissionCheck.ReadWriteSubTree, RegistryRights.FullControl))

{
      // Doing some operation like  reading some value
}
 
Exception:

Requested registry access is not allowed.

Can any body help me to come out. 
 
Answers (7)
0
Richard Bourne
NA 3 4.1k 14y
Hi all,

This has been resolved now so for anyone else suffering this problem:

I needed to go to Application Pools > Advanced Settings and then set Enable 32-bit Applications to true.

Hope this can help somebody.