469,648 Members | 1,413 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

Create New EventLog

Hi NG
I try to create a new EventSource in an asp.net projetct with the following
code but I always get the error
Registry access nod allowed...
I changed the userName in the processModell of my machine.config file to
SYSTEM.
What else do I have to do?
try
{
if (!System.Diagnostics.EventLog.SourceExists(applica tionName))
{
System.Diagnostics.EventLog.CreateEventSource(appl icationName, "ESHOP");
}
}
catch(System.Security.SecurityException e)
{
throw new System.Security.SecurityException(e.Message);
}

tnx

stefan
Nov 15 '05 #1
1 4488
Stefan, You can do a couple of things,

1. Change the access that the aspnet user has on your web server so that it
is allowed access to the event log.
2. Change the user under which ASP.Net runs.
3. Use impersonation for that section of code to impersonate a privileged
use while running within the ASP.Net process.

--
Greg Ewing [MVP]
http://www.claritycon.com/
"Stefan" <sh****@steffsworld.ch> wrote in message
news:O5**************@tk2msftngp13.phx.gbl...
Hi NG
I try to create a new EventSource in an asp.net projetct with the following code but I always get the error
Registry access nod allowed...
I changed the userName in the processModell of my machine.config file to
SYSTEM.
What else do I have to do?
try
{
if (!System.Diagnostics.EventLog.SourceExists(applica tionName))
{
System.Diagnostics.EventLog.CreateEventSource(appl icationName, "ESHOP");
}
}
catch(System.Security.SecurityException e)
{
throw new System.Security.SecurityException(e.Message);
}

tnx

stefan

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Jacob Colding | last post: by
17 posts views Thread by Chris Podmore | last post: by
6 posts views Thread by Philip Wagenaar | last post: by
1 post views Thread by martin | last post: by
3 posts views Thread by Ben | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.