2011-04-17 43 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,任何用戶都有寫入權限(就像一個文件的目錄是全開的)

相關問題