E
Eric Johannsen
My aspx page can not write to the EventLog "Requested registry access is not
allowed". I have read the posts about ASPNET not having access to create
new event sources, so I created a little installer that pre-creates the
event sources. That installer writes a test entry to the event log for my
source so I can see that it has been created.
Still, the aspx page fails to write to the event log.
Any ideas?
Thanks,
Eric
TEST CODE:
btnWriteEventLog_Click(object sender, System.EventArgs e)
{
EventLog log = new EventLog();
try
{
log.Log = "MyLog";
log.Source = "MySource";
log.WriteEntry("Test", EventLogEntryType.Information);
}
catch (Exception E)
{
string s;
s = E.Message; // E.Message contains: "Requested registry access is
not allowed"
}
}
allowed". I have read the posts about ASPNET not having access to create
new event sources, so I created a little installer that pre-creates the
event sources. That installer writes a test entry to the event log for my
source so I can see that it has been created.
Still, the aspx page fails to write to the event log.
Any ideas?
Thanks,
Eric
TEST CODE:
btnWriteEventLog_Click(object sender, System.EventArgs e)
{
EventLog log = new EventLog();
try
{
log.Log = "MyLog";
log.Source = "MySource";
log.WriteEntry("Test", EventLogEntryType.Information);
}
catch (Exception E)
{
string s;
s = E.Message; // E.Message contains: "Requested registry access is
not allowed"
}
}