【发布时间】:2011-03-20 07:32:38
【问题描述】:
我有一个 .NET Web 服务正在尝试记录到 Windows 事件日志。但是,当我尝试向此 Web 服务中的 Web 方法发送 SOAP 请求时,我在 SOAP 响应中返回此错误:
System.InvalidOperationException:无法打开源“MySource”的日志。您可能没有写入权限。 ---> System.ComponentModel.Win32Exception: 访问被拒绝
我已经尝试在谷歌上搜索解决方案。 This one 描述了在 Windows 7 64 位中编辑对我来说不存在的注册表项; this Microsoft page 相同。 This question 是相关的,但它的唯一答案是在 HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\eventlog\MySource 中似乎没有任何地方的“源”键。如果我需要添加 Source 键,它的值需要是什么?我在我的 Web 服务的 Web.config (<identity impersonate="true" />) 中使用模拟。 This question 也是相关的,但没有答案。 This question 是相关的,但它的答案似乎与 Windows 7 中的注册表设置无关。
我的 Web.config 中同时设置了 <authentication mode="Windows" /> 和 <identity impersonate="true" />。但是,即使我删除了<authentication mode="Windows" />,我仍然会收到“无法打开源日志”错误。
【问题讨论】:
标签: .net web-services permissions impersonation event-log