why is registry access denied - 'System.Security.SecurityException' in mscorlib.dll

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • starrysky
    New Member
    • Dec 2009
    • 10

    why is registry access denied - 'System.Security.SecurityException' in mscorlib.dll

    Trying to read key "HKLM\SOFTWARE\ Policies\Micros oft\Windows\Win dowsUpdate\AU" value "AUOptions"

    and get the following :
    A first chance exception of type 'System.Securit y.SecurityExcep tion' occurred in mscorlib.dll
    Error occurs in ReadRegistry key SOFTWARE\Polici es\Microsoft\Wi ndows\WindowsUp date\AU : Requested registry access is not allowed
    .

    This occurs in my vb.net application when application is run under an account called OPER in the USERS group. The application :
    1/is on my PC's hard drive, its not a web app or on a network share
    2/is launched via a desktop click
    3/ has a manifest specifying executionlevel "AsInvoker"

    It does not occur when the Application is run as an Administrator. It does not occur if I read the value with a non .NET program when logged in as OPER whch makes me think it is a .NET problem not a registry permissions problem.
    Examining "Effective Permissions" shows that my OPER login has query value permission.

    I need the application to be able to read the key like the non .NET application while running at USERS level. Anyone any ideas what the problem is please?
  • starrysky
    New Member
    • Dec 2009
    • 10

    #2
    Apologies for posting original message, silly mistake- I have cracked this myself

    I had opened the registry subkey requesting write access
    Key = ParentKey.OpenS ubKey("SOFTWARE \Policies\Micro soft\Windows\Wi ndowsUpdate\AU" , true)

    And so it was denied - I needed it to be read only
    Key = ParentKey.OpenS ubKey("SOFTWARE \Policies\Micro soft\Windows\Wi ndowsUpdate\AU" , False)

    Comment

    Working...