ASP.Net 3.5 running under IIS 7 doesn\'t seem to allow this out of the box.
if (!EventLog.SourceExists(\"MyAppLog\"))
EventLog.CreateEven
This is part of windows security since windows 2003.
You need to create an entry in the registry under HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Eventlog\Application Make sure that network service or the account you impersonate has permission to this registry key.
@CheGueVerra's link: Requested Registry Access Is Not Allowed