Event log access problem with ASP.NET

P

Phil Turtle

We're using the Application block for publishing exceptions from our web
site using the default publisher which writes to the event log. This works
fine on XP and on one of our dev. machines running Windows 2003. However we
now have a problem on a test machine with Windows 2003 where we get a
security exception because the process doesn't have access to the event log.
The only difference I know of is that the test machine has Windows 2003 SP1.
On both W2003 machines IIS6 is running under the default account which
supposedly has access to the event log resource.

Has anyone any ideas of how to solve this? Is it due to a change in the O/S
service pack?

(We are using .NET 1.1)

Phil
 
D

Dominick Baier [DevelopMentor]

Hi,

you have to create the event source first, this has to be done from an account
with administrative privileges.

EventLog.CreateEventSource(..);
 
A

asmund.kristiansen

Phil said:
We're using the Application block for publishing exceptions from our web
site using the default publisher which writes to the event log. This works
fine on XP and on one of our dev. machines running Windows 2003. However we
now have a problem on a test machine with Windows 2003 where we get a
security exception because the process doesn't have access to the event log.
The only difference I know of is that the test machine has Windows 2003 SP1.
On both W2003 machines IIS6 is running under the default account which
supposedly has access to the event log resource.

Has anyone any ideas of how to solve this? Is it due to a change in the O/S
service pack?

(We are using .NET 1.1)

Phil


Hi, make sure the account running the application pool that your web
application is using has access to:
"HKLM\SYSTEM\ControlSet001\Services\EventLog". As default
application pools are running as network service, that don't have
access to this key.


Regards,
Åsmund
 
D

Dominick Baier [DevelopMentor]

Hi,

as stated before - the asp.net worker process does not have the required
rights for the registry key

you have two options:

a) change the ACL
b) pre-create the EventSource using a console helper that is run by an admin
- ASP.NET will be able to use the event log afterwards
 
P

Phil Turtle

As I stated before this is NOT the problem. The Event source already exists.
It is NOT - repeat NOT - a registry permission problem

Phil
 
D

Dominick Baier [DevelopMentor]

Hi,

so can you show us the exception details with full stack trace?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,060
Latest member
BuyKetozenseACV

Latest Threads

Top