"无法打开日志源" - Windows 7的 - .NET Web服务 - 事件日志 [英] "Cannot open log for source" - Windows 7 - .NET web service - event log

查看:227
本文介绍了"无法打开日志源" - Windows 7的 - .NET Web服务 - 事件日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个.NET Web服务正试图登录到Windows事件日志。但是,当我尝试SOAP请求在此Web服务发送给Web方法,我在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

我已经试过周围的Googling寻求解决方案。 <一href="http://littletalk.word$p$pss.com/2009/07/13/cannot-open-log-for-source-you-may-not-have-write-access/"相对=nofollow>这一次介绍了编辑,我在Windows 7中不存在的注册表项64位;相同的此Microsoft页面。 <一href="http://stackoverflow.com/questions/2479152/cannot-open-log-for-source-0-on-windows-2003-server">This问题是相关的,但它的唯一的答案谈论一个'源'键似乎并没有在任何地方在HKEY_LOCAL_MACHINE \系统\ CurrentControlSet \服务\事件日志\ MYSOURCE。如果我需要添加源键,这是什么它的价值需要是什么?我用我的Web服务的Web.config模拟(&LT;身份冒充=真/&GT; )。 <一href="http://stackoverflow.com/questions/3300883/error-when-attempting-to-write-to-event-log-cannot-open-log-for-source-sourcen">This问题相关很好,但没有答案。 <一href="http://stackoverflow.com/questions/1168038/web-service-cannot-write-to-event-log-when-called-by-anonymous-user">This问题是相关的,但它再次回答似乎并没有涉及到注册表设置在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.

我有两个&LT;身份验证模式=窗口/&GT; &LT;身份冒充=真/&GT; 在我的Web.config设置。但是,即使我删除&LT;身份验证模式=窗口/&GT; ,我仍然得到无法打开日志源错误

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.

推荐答案

我有完全相同的问题,在Windows 7 64位我的经典ASP Web应用程序。我最终发现,通过更改应用程序池,该网站为启用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. Talk about a red herring error message! Anyway, hopefully this helps someone...

这篇关于&QUOT;无法打开日志源&QUOT; - Windows 7的 - .NET Web服务 - 事件日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆