由于某些原因,当我在web.config中使用模拟选项时。一切都很好,但有一个问题困扰着我,那就是在使用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)有谁对此有什么建议吗?提前谢谢。
发布于 2016-04-07 04:24:01
被模拟的用户没有写入事件日志的权限。
我建议您使用任何用户都有写访问权限的TraceListener (比如目录是完全开放的文件。
https://stackoverflow.com/questions/5691655
复制相似问题