What do I need to change to allow my IIS7 ASP.Net 3.5 application to create an event source and log events to Windows EventLog?

前端 未结 3 1573
你的背包
你的背包 2020-11-30 01:05

ASP.Net 3.5 running under IIS 7 doesn\'t seem to allow this out of the box.

        if (!EventLog.SourceExists(\"MyAppLog\"))
            EventLog.CreateEven         


        
3条回答
  •  Happy的楠姐
    2020-11-30 01:38

    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

提交回复
热议问题