Click here to Skip to main content
11,576,354 members (58,464 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: VB.NET
Hello,

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

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 12-Oct-12 3:05am
Edited 12-Oct-12 3:26am
Nelek71.1K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Since Vista OS an application needs elevated privileges to access 'Local Machine' subtree. See additional info at Stack Overflow[^].
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

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.
  Permalink  

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 271
1 F-ES Sitecore 140
2 Abhinav S 135
3 Lucifier Rocks 105
4 Dave Kreskowiak 80
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 626
2 Abhinav S 483
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365


Advertise | Privacy | Mobile
Web04 | 2.8.150603.1 | Last Updated 9 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100