Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello,

The application is written in vb.net. When debugging the code, the section which causes an issue is as follows:

VB
Dim RegKey As RegistryKey
RegKey = Registry.LocalMachine.OpenSubKey(Path, True)


When the above statement is executed the exception 'Requested registry access is denied' occurred. Operating system is of Windows #7.


It must be mentioned that the above code works perfectly on Windows XP.

Any help would be appreciated.
Posted
Updated 12-Oct-12 3:26am
v2

Since Vista OS an application needs elevated privileges to access 'Local Machine' subtree. See additional info at Stack Overflow[^].
 
Share this answer
 
SQL
This package was written a few years ago in order to implant a few details in registry. I appreciate that Microsoft promote individual to use ‘Settings’ or create some kind of XML file to save any details which your package need. As a result my approach is as such now days.

However, in order to resolve this issue and for the purpose of debugging, I have disabled UAC (User Account Control). By implementing this, the issue is resolved.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900