The problem is that the aspnet account, by default, does not have the
security rights to create the event log application. You can manually
create this by editing the registry. Go to
HKLM\System\CurrentControlSet\Services\EventLog\Ap plication and add a node
underneath with the name of the application you are reporting in the event
log.
You can find the MS article on this problem here:
http://support.microsoft.com/default...Product=aspnet
Jeff
"John Saunders" <john.saunders at SurfControl.com> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
"Suhail Salman" <su****@access2arabia.com> wrote in message
news:OV**************@tk2msftngp13.phx.gbl... Dear all,
why do i get the following exception when i try to write to the
event log from a webform. and how can i resolve it?
Description:
The application attempted to perform an operation not allowed by the
security policy. To grant this application the required permission
please contact your system administrator or change the application's trust
level in the configuration file.
Exception Details: System.Security.SecurityException: Requested registry
access is not allowed.
i changed the trust level in my computer zone to full trust. but its
still the same, even though that this exception is thrown from a dll which is
referenced in the major project.
This problem usually occurs when there is no event source defined. The
first write to the event source will try to create it. That's what you don't
have access to do.
Create the event source manually first. Look into the EventLogInstaller
class.
--
John Saunders
John.Saunders at SurfControl.com