Error:
System.Security.SecurityException: Requested registry access is not allowed.
Grant permission to create a custom event log
- Log on to the computer as an administrator.
- Click Start, click Run, type regedit in the Open box, and then click OK. The Registry Editor window appears.
- Locate the following registry subkey:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
- Right-click Eventlog, and then click Permissions. The Permissions for Eventlog dialog box appears.
- Click Advanced. The Advanced Security Settings for Eventlog dialog box appears.
- In the Name column, double-click the Users group. The Permission Entry for Eventlog dialog box appears.
- Select the Set Value check box, select the Create Subkey check box, and then click OK.
- Quit Registry Editor, and then log off from the administrator account.
- Log on to the computer as a regular user.
- Try to create a custom event log by using Visual Studio .NET, and then try to write to this event log by using an application that is built on Visual Studio .NET.
Ref URL:- http://support.microsoft.com/kb/842795
No comments:
Post a Comment