asp.net - 我需要更改什么才能允许IIS7 ASP.Net 3.5应用程序创建事件源并将事件记录到Windows EventLog?

标签 asp.net .net-3.5 iis-7 permissions event-log

在IIS 7下运行的ASP.Net 3.5似乎不允许这样做。

        if (!EventLog.SourceExists("MyAppLog"))
            EventLog.CreateEventSource("MyAppLog", "Application");

        EventLog myLog = new EventLog();
        myLog.Source = "MyAppLog";
        myLog.WriteEntry("Message");

最佳答案

自Windows 2003以来,这是Windows安全性的一部分。

您需要在注册表中的HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Services \ Eventlog \ Application下创建一个条目。确保网络服务或您模拟的帐户对该注册表项具有权限。

@CheGueVerra的链接:Requested Registry Access Is Not Allowed

关于asp.net - 我需要更改什么才能允许IIS7 ASP.Net 3.5应用程序创建事件源并将事件记录到Windows EventLog?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/286060/

相关文章:

c# - 在 ASP.NET 中从 SQL 数据库输出一条记录的一个字段

.net - 如何让用户在 session 之间持续存在?

c# - WCF REST 服务的 Azure 缓存间歇性响应时间

.net - 适用于 .NET 3.5(或 4.0)的优秀 XMPP/Jabber 客户端库

c# - Xml 序列化后代列表

c# - 应用程序池错误

ASP.NET 在不断更新的 Firefox Chrome 中保持滚动位置或回发

IIS7 : Faulting application w3wp. exe,这些崩溃的根本原因是什么?

wcf - WCF 服务中莫名其妙的程序集负载 (IIS 7)

c# - 在 4 中使用 3.5 组件