Wednesday, January 21, 2009

Problems while writing EventLog from ASP.NET Web Application

Problems while Event Log for a Business Logic Layer (BLL) from ASP.NET Web Application

Error:
System.Security.SecurityException: Requested registry access is not allowed.

Grant permission to create a custom event log

  1. Log on to the computer as an administrator.
  2. Click Start, click Run, type regedit in the Open box, and then click OK. The Registry Editor window appears.
  3. Locate the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog
  4. Right-click Eventlog, and then click Permissions. The Permissions for Eventlog dialog box appears.
  5. Click Advanced. The Advanced Security Settings for Eventlog dialog box appears.
  6. In the Name column, double-click the Users group. The Permission Entry for Eventlog dialog box appears.
  7. Select the Set Value check box, select the Create Subkey check box, and then click OK.
  8. Quit Registry Editor, and then log off from the administrator account.
  9. Log on to the computer as a regular user.
  10. 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: