2011-04-17 44 views
2

由于某些原因,当我在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) 

任何人给我一些这方面的建议?提前致谢。

回答

0

正在模拟的用户无权写入事件日志。

我建议你使用TraceListener,任何用户都有写入权限(就像一个文件的目录是全开的)

相关问题