日志记录应用程序块不会将日志条目添加到构建应用程序的计算机以外的计算机上的事件查看器
我正在使用(Microsoft Enterprise Library 5.0 的)日志记录应用程序块在事件查看器中记录 WPF XBAP 应用程序中发生的异常。
但是,只有当应用程序在我的机器(构建它的机器)上运行时,才会记录异常。任何其他机器都不会记录任何内容。
我试图找到可能发生这种情况的原因 - 我尝试将 requirePermission 设置为 false - 但无济于事。
有人对为什么会发生这种情况有任何想法吗?
I am using the Logging Application Block (of Microsoft Enterprise Library 5.0) to log exceptions in the Event Viewer that occur in my WPF XBAP application.
However, exceptions are only being logged if the application is run on my machine (the machine it was built on). Any other machine it doesn't log anything.
I've tried to find a reason why this might be occurring - I've tried setting requirePermission to false - but to no avail.
Anyone any ideas on why this might be happening?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
记录到事件日志需要权限。
不确定这是否是您的情况的问题,但典型的情况是:在开发机器上,程序在作为管理员的登录用户的上下文中运行,部署时,它在权限较少的用户的上下文中运行。
另一件需要注意的事情是应用程序的部署方式,如果操作系统认为该程序来自互联网,它将限制该程序可以执行的操作。
Logging to eventlog requires rights.
Not sure if this is the problem in your case, but typical scenario is: On dev machine program runs in context of logged on user which is an administrator, when it is deployed it is running in the context of a user with fewer rights.
The other thing to watch out for, is how the app is being deployed, if the OS thinks that the program came from the internet it will restrict what the program can do.