Re: Requested registry access is not allowed.

Tech-Archive recommends: Fix windows errors by optimizing your registry




"Steve Teeples" <SteveT@xxxxxxxxxxxxxxxxx> wrote in message
news:FB24C9A3-0855-4943-82E6-0E01DA7147DD@xxxxxxxxxxxxxxxx
|I have a piece of code (written is Visual Studio 2005) that is only reading
| the Security EventLog. On Windows XP Professiona/Home this code works
just
| fine.
|
| int numberOfEntries = myEventLog.Entries.Count;
| if (numberOfEntries > 0) ...
|
| However, when run under Windows Vista I get the error "Requested registry
| access is not allowed." This error occurs when the first line of code is
| executed.
|
| I tried adding the command below before the count is retrieved but it
didn't
| work.
|
| EventLogPermission elp = new
| EventLogPermission(EventLogPermissionAccess.Administrator, ".");
|
| Does anyone know how to get around this issue. This error only occurs
with
| the Security event log, not the "Application" or "System" event logs.
|
| --
| -----------
| Thanks,
| Steve

Because of User Account Control (UAC) in Vista, the application requires
elevated permissions to get at the Security data. Please read this:
http://msdn.microsoft.com/windowsvista/reference/security/default.aspx?pull=/library/en-us/dnlong/html/accprotvista.asp,
especially the part that talks about an assembly manifest.

Note also that you should post Vista related questions to the Microsoft
forums at http://forums.microsoft.com

Willy.


.



Relevant Pages

  • What Does It Take to Get a PC With XP?
    ... I won't waste time rehashing the argument over whether Windows Vista ... that virtually every copy of Vista Business or Vista Ultimate Edition ... machines doesn't mean that its employees understand that policy. ...
    (misc.consumers)
  • Re: List of Applications Not Compatible with Leopard
    ... If there is an equal on Windows I truly would love to know about ... program on the Plasq frontpage was clearly taken on Vista. ... the product is on both Windows and Mac. ... hardware than Vista works on PC hardware is hardly "silly". ...
    (comp.sys.mac.advocacy)
  • Re: OS/2 mentioned in a Vista review
    ... You can also install it in a classic way in 2K (and XP, and 2003 and Vista) by ... That may be a good basis of comparison for you, but to someone who is already displeased with the previous standard of operation of Windows, what should that mean? ... It can be done on XP or OS/2, ... Consider: full-screen apps. ...
    (comp.os.os2.misc)
  • Re: I cant install critical updates
    ... I resolved error message problem from Vista Security Center by uninstalling and reinstalling Antivir. ... How it comes I can't either manage to install manually failing updates? ... Be sure to obtain the correct version for Windows x86. ... Windows Update Agent File Versions: ...
    (microsoft.public.windowsupdate)
  • Re: Format again
    ... specs to see if it can handle Vista. ... and I want to reformat my hard disk and re-install Windows XP ... and update it with a Vista upgrade which my good lady brought ... Instead of performing a clean install of XP, ...
    (microsoft.public.windowsxp.help_and_support)