Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Security / November 2003

Tip: Looking for answers? Try searching our database.

Custom Event Log Write Error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
TJO - 26 Nov 2003 21:01 GMT
We are experiencing the following error when writing to a custom log file:
"Requested registry access is not allowed."

We have created the custom log file using the code below and then add full
permissions to the ASPNET account at the Registry Key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog.

We do not experience the error when writing to the "Application" Event log
or if we run the code from a windows form application.

// Code Fails when writing to custom event log "SR_AppLog
EventLog appLog = new EventLog("SR_AppLog", ".");
appLog.Source = "SR_AppDev";
appLog.WriteEntry("foo bar: database error");
appLog.Dispose();

//Code executs when writing to "Application" event log
EventLog appLog = new EventLog("Application");
appLog.Source = "SR_AppSrc";
appLog.WriteEntry("foo bar: database error");
appLog.Dispose();

//Installer class to create the custom event log
namespace EventLogSourceInstaller

{

[RunInstaller(true)]

public class MyEventLogInstaller : Installer

{

private EventLogInstaller myEventLogInstaller;

public MyEventLogInstaller()

{

//Create Instance of EventLogInstaller

myEventLogInstaller = new EventLogInstaller();

// Set the Source of Event Log, to be created.

myEventLogInstaller.Source = "SR_AppDev";

// Set the Log that source is created in

myEventLogInstaller.Log = "SR_AppLog";

// Add myEventLogInstaller to the Installers Collection.

Installers.Add(myEventLogInstaller);

}

}

}
Stefano Pronti [MS] - 28 Nov 2003 09:24 GMT
Have a look at that:
329291 PRB: "Requested Registry Access Is Not Allowed" Error Message When
http://support.microsoft.com/?id=329291

Cheers,
 Stefano Pronti

 Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.

> We are experiencing the following error when writing to a custom log file:
> "Requested registry access is not allowed."
[quoted text clipped - 56 lines]
>
> }
TJO - 28 Nov 2003 19:25 GMT
we have followed these instructions on your recommended article.  The
problem with the article is that it explains how to set permission for the
"Application" event log.  It then goes on to show how to create your own
Even Log using a custom installer class which is also what we have done.
Our problem is that we can write to the Application event log but not to the
custom event log.  We only get the Acccess not allowed error when writing to
the custom event log.  Writing to the Application event log is no problem.

Has anyone done this before?  What sercurity setting should I look for ?

> Have a look at that:
> 329291 PRB: "Requested Registry Access Is Not Allowed" Error Message When
[quoted text clipped - 67 lines]
> >
> > }

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.