服务器 windows server 2008 R2
iis 7
错误消息
The source was not found, but some or all event logs could not be searched. To create the source, you need permission to read all event logs to make sure that the new source name is unique. Inaccessible logs: Security.]
开始以为是权限问题,更换了 应用程序池的进程模型标识 Network Service,发现根本没有作用。
chinapay 的demo里有一个 chinapaysecure.dll 文件,这个文件应该是使用EventLog 之类的操作,记录系统日志。
服务器拒绝了这种操作。解决方法
- 管理员身份登录计算机。
- 依次单击“开始”和“运行”,在“打开”框中键入 regedit,然后单击“确定”。这将打开“注册表编辑器”窗口。
- 找到以下注册表子项:
HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog
- 右键单击“Eventlog”,然后单击“权限”。这将显示“Eventlog 的权限”对话框。
- 单击“高级”。此时显示“Eventlog 的高级安全设置”对话框。
- 在“名称”列中,双击“Users”组。这将显示“Eventlog 的权限项目”对话框。
- 依次选中“设置数值”和“创建子项”复选框,然后单击“确定”。
- 右键点击:HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog,选择Permissions. 给 "Network Service" 赋予合适的权限。(如果您在ASP.NET中impersonate到其他的用户, 请合适的替换ASPNET)
- 右键点击HKEY_LOCAL_MACHINE/SYSTEM/CurrentControlSet/Services/Eventlog/Security,选择Permissions. 给 "Network Service" 赋予至少Read的权限。(如果您在ASP.NET中impersonate到其他的用户, 请合适的替换ASPNET)