473,383 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

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

Trying to read key "HKLM\SOFTWARE\Policies\Microsoft\Windows\WindowsU pdate\AU" value "AUOptions"

and get the following :
A first chance exception of type 'System.Security.SecurityException' occurred in mscorlib.dll
Error occurs in ReadRegistry key SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\ 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?
Jan 11 '10 #1
1 9211
Apologies for posting original message, silly mistake- I have cracked this myself

I had opened the registry subkey requesting write access
Key = ParentKey.OpenSubKey("SOFTWARE\Policies\Microsoft\ Windows\WindowsUpdate\AU", true)

And so it was denied - I needed it to be read only
Key = ParentKey.OpenSubKey("SOFTWARE\Policies\Microsoft\ Windows\WindowsUpdate\AU", False)
Jan 11 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: James B | last post by:
OMA (Outlook Mobile Access) under Exchange is giving me a System.Security.SecurityException error. From what I gather this is a problem with the security level under which the OMA application is...
2
by: MFRASER | last post by:
I am getting a System.Security.SecurityException when I try and laod a dataset from an xml file any ideas on what would cause this? System.Security.SecurityException' occurred in mscorlib.dll ...
2
by: Ray5531 | last post by:
I keep getting this error when my asp.net application tries to write into the registry System.Security.SecurityException: Requested registry access is not allowed. I followed the following...
3
by: Carl | last post by:
Hi. I have my program written as a console application in C# .NET 2005. I run it from a server on the local intranet and I got this message: An unhandled exception of type...
0
by: Steve | last post by:
I am using Visual Studio .NET 2003, which has .NET framework 1.1. When I tried to run .NET web services client, I got the following error: Security Exception Error Message: An unhandled...
5
by: Ankit Aneja | last post by:
This is my problem. I am using Visual 2003, .Net framework 1.1 and the Application Block I configured the DAAB using the Enterprise Library Configuration now this is the error which is coming ...
3
by: steveeisen | last post by:
microsoft.public.dotnet.languages.vb.upgrade isn't getting much traffic, so I'll try here. Ours is a VB6 shop exploring .NET. First I wrote a new application with VB .NET 2003 to create a...
4
by: stephen | last post by:
Hi, I am getting an error while trying to create an excel file. "Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the...
4
by: confused1234 | last post by:
I get the error at the bottom of this post when i click on a linkbutton, javascript:__doPostBack('ctl00$Main$btnchangeemail','') The problem is intermitant, sometimes it works and sometimes...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.