我正在尝试部署一个.NET Web应用程序,使用模拟来完成安全性。
写入事件日志在我的开发框(Win 2003 IIS6)上工作正常,但将应用程序放在活动框(Win 2008 IIS7)后,我得到以下;
Access is denied [Win32Exception (0x80004005): Access is denied] [InvalidOperationException: Cannot open log for source 'MyApp'. You may not have write access.] System.Diagnostics.EventLog.OpenForWrite(String currentMachineName) +1815151 System.Diagnostics.EventLog.InternalWriteEvent(UInt32 eventID, UInt16 category, EventLogEntryType type, String[] strings, Byte[] rawData, String currentMachineName) +452 System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) +463 System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type) +30
我在谷歌上find的最好的帮助是; http://support.microsoft.com/default.aspx?scid=kb;en-us;323076 | http://msdn.microsoft.com/en-us/library/aa379570%28VS.85%29.aspx
提到; HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ Services \ Eventlog \ Application \ CustomSD混淆我,因为我没有在活箱上的registry项中的此。
利利帮助?
即使使用模拟,也可能使用您的应用程序池标识。 一些应用程序还原自己,不尊重模仿。
来自sysinternals的进程监视器将成为你在这个项目上的朋友。 它在生产服务器上是免费且安全的。 启动它并重现情况以获得捕获。 然后search拒绝单词,或searchCustomSD或Eventlog。 应该出现的模式将显示哪个用户试图访问以及如何授予该用户访问权限。