Please move this to the Vista forums, this issue is not C# or .NET related,
it's about the way security is implemented in Vista.
http://msdn.microsoft.com/windowsvis...cprotvista.asp,
explain exactly what should be done to run with elevated privileges.
Note that by default the Administrator account is disabled in Vista, you
aren't running with administrator privileges, even if you are a member of
administrators!. I would suggest you read as much as you can about the new
security model before you start coding, also keep in mind that Vista is
still in beta, nothing is carved in stone yet and many things might change
before RTM.
Willy.
"Steve Teeples" <St****@newsgroups.nospam> wrote in message
news:C8**********************************@microsof t.com...
| How does one go about configuring a C# appliation to run with Admin
| privileges? My test tool is installed under the adminitstrator login and
| runs in that environment.
|
| I don't understand what needs to be done to do this.
|
| This line of code (reading the number of Security EventLog entries) is the
| only line (out of 1000's) that will not run under Vista. I find it
| frustrating.
| --
| -----------
| Thanks,
| Steve
|
|
| "Willy Denoyette [MVP]" wrote:
|
| >
| > "Steve Teeples" <St****@newsgroups.nospam> wrote in message
| > news:FB**********************************@microsof t.com...
| > |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.Admini strator, ".");
| > |
| > | 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/windowsvis...cprotvista.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.
| >
| >
| >