EMAB EventLog errors - Thea Burger's Blog

Thea Burger's Blog

Wouldn't you like to know...

News

Photo's!!!

About me

I'm Reading: General Blogs

I'm Reading: Technical Blogs

EMAB EventLog errors

I decided to use the Exception Management Application Block in our application, but after I installed it and tried to test it I got the following error:
System.Security.SecurityException: Requested registry access is not allowed.
After searching and suggestions that I should modify the registry I got this correct answer:
Run installutil “<path>\Microsoft.ApplicationBlocks.ExceptionManagement.dll"

Unfortunately after that I got the next error:
System.ComponentModel.Win32Exception: Access is denied on the line: EventLog.WriteEntry(applicationName, entry, type)
I tried setting the permissions on a couple of registry keys, to no avail... Then I added the following to the web.config <identity impersonate="true" userName="Administrator" password="123456"/> and it worked!! Obviously not the best solution, so I decided to try the registry again.
Solution:
Go to the HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog key and select permissions. Make sure the ASPNET account is there (I gave it full control at this stage) and go to advanced.
Tick the 'Replace permission entries on all child objects........“ and click Apply.

Voila!

Comments

Rich...! said:

Oh, yeah, that's how I would have done it too...!
# January 19, 2005 2:57 PM

Thea Burger said:

:P
# January 20, 2005 6:53 AM

Luigi said:

the most solid solution to date!
# April 21, 2005 1:15 PM

Sandeep said:

Its not working this way...Infact I added those DLL's to GAC also...nothing works
# April 24, 2006 1:52 PM