&“无法打开源日志"-Windows 7-.NET Web服务-事件日志 [英] "Cannot open log for source" - Windows 7 - .NET web service - event log
问题描述
我有一个试图登录Windows事件日志的.NET Web服务.但是,当我尝试向该Web服务中的Web方法发送SOAP请求时,我在SOAP响应中得到了以下错误:
I have a .NET web service that is trying to log to the Windows Event Log. However, when I try to send a SOAP request to a web method in this web service, I get back this error in the SOAP response:
System.InvalidOperationException:无法打开源"MySource"的日志.您可能没有写权限.---> System.ComponentModel.Win32Exception:访问被拒绝
System.InvalidOperationException: Cannot open log for source 'MySource'. You may not have write access. ---> System.ComponentModel.Win32Exception: Access is denied
我已经尝试了Google搜索以寻求解决方案.这个介绍了如何编辑Windows 7 64位版中不存在的注册表项;与此Microsoft页面相同.这个问题是相关的,但唯一的答案它谈论的是源"键,该键似乎不在HKEY_LOCAL_MACHINE \ System \ CurrentControlSet \ Services \ eventlog \ MySource中的任何位置.如果我需要添加Source键,那么它的值应该是多少?我在Web服务的Web.config(< identity impersonate ="true"/>
)中使用模拟.这个问题也相关,但没有答案.此问题与但同样,它的答案似乎与Windows 7中的注册表设置无关.
I've tried Googling around for a solution. This one describes editing a registry key that does not exist for me in Windows 7 64-bit; same for this Microsoft page. This question is related but the only answer to it talks about a 'Source' key that does not seem to be anywhere in HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\eventlog\MySource. If I need to add a Source key, what does its value need to be? I am using impersonation in my web service's Web.config (<identity impersonate="true" />
). This question is related as well but has no answers. This question is related but again its answer doesn't seem to pertain to the registry setup in Windows 7.
我在Web.config中同时设置了<身份验证模式="Windows"/>
和
< authentication mode ="Windows"/>
,我仍然会收到无法为源打开日志"错误.
I have both <authentication mode="Windows" />
and <identity impersonate="true" />
set in my Web.config. However, even when I remove <authentication mode="Windows" />
, I still get the "Cannot open log for source" error.
推荐答案
我的经典ASP Web应用程序在Windows 7 64位中遇到了完全相同的问题.我最终发现,通过将该网站的应用程序池更改为启用32位应用程序"(右键单击应用程序池,高级设置),问题消失了.
I was having the exact same problem in Windows 7 64 bit for my classic ASP web application. I eventually found that by changing the application pool for that website to "Enable 32-bit Applications" (right-click application pool, advanced settings) the problem disappeared.
这篇关于&“无法打开源日志"-Windows 7-.NET Web服务-事件日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!