【发布时间】:2012-03-22 19:02:30
【问题描述】:
我收到以下异常。我已经在注册表编辑的事件日志中完全控制了 Asp.net 帐户。
[SecurityException: 未找到源,但部分或全部事件 无法搜索日志。无法访问的日志:安全性。]
System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) +664 System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) +109 System.Diagnostics.EventLog.SourceExists(String source) +14 Microsoft.ApplicationBlocks.ExceptionManagement.DefaultPublisher.VerifyValidSource() +41
我猜这是因为服务器上的一些配置问题?
【问题讨论】:
-
我发布了我的答案,版主删除了它。请确保将您的服务作为本地系统而不是其他系统运行,因为本地系统只能创建事件日志和源。我将我的服务作为网络服务运行并得到了这个异常。后来我停止服务并作为本地系统重新启动,它工作正常,之后我停止并重新启动我的服务作为网络服务,它工作正常。
标签: c# .net windows-7 event-log securityexception