C# 使用模拟时写入事件日志
由于某种原因,当我在web.config中使用模拟选项时。一切正常,但有一个问题困扰着我,即使用C# 使用模拟时写入事件日志,c#,.net,asp.net,event-log,tracesource,C#,.net,Asp.net,Event Log,Tracesource,由于某种原因,当我在web.config中使用模拟选项时。一切正常,但有一个问题困扰着我,即使用System.Diagnostics.TraceSource写入事件日志时发生以下错误: System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.ComponentModel.Win32Except
System.Diagnostics.TraceSource
写入事件日志时发生以下错误:
System.Web.HttpUnhandledException (0x80004005):
Exception of type 'System.Web.HttpUnhandledException' was thrown.
---> System.ComponentModel.Win32Exception (0x80004005):
Access is denied at System.Diagnostics.EventLogInternal.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName)
at System.Diagnostics.EventLogInternal.WriteEvent(EventInstance instance, Byte[] data, Object[] values)
at System.Diagnostics.TraceSource.TraceEvent(TraceEventType eventType, Int32 id, String message)
有人给我一些建议吗?提前感谢。被模拟的用户没有写入事件日志的权限
我建议您使用任何用户都有写入权限的TraceListener(如目录完全打开的文件)。被模拟的用户没有写入事件日志的权限 我建议您使用任何用户都有写访问权限的TraceListener(比如目录完全打开的文件)