0

我正在尝试建立一个在后台运行在一堆远程计算机上的服务,该服务将简单地监控 IE 用于统计目的的次数。我的大部分代码都是编写的,它在我的开发计算机上运行得非常好,它与远程计算机具有相同的规格。我还确保远程计算机都安装了 Net Framework 4.5.1。

启动服务时,我收到此错误消息(我记录它)

System.Runtime.InteropServices.COMException (0x80040202): Exception HRESULT : 0x80040202
at System.Runtime.InteropServices.ComTypes.IConnectionPoint.Advise(Object pUnkSink, Int32& pdwCookie)
at System.Runtime.InteropServices.ComEventsSink.Advise(Object rcw)
at System.Runtime.InteropServices.ComEventsInfo.AddSink(Guid& iid)
at System.Runtime.InteropServices.ComEventsHelper.Combine(Object rcw, Guid iid, Int32 dispid, Delegate d)
at System.Runtime.InteropServices.ComAwareEventInfo.AddEventHandler(Object target, Delegate handler)
at ServiceLogger.Service1..ctor()

这是导致此错误的代码,它发生在我的服务由program.cs创建时,我没有修改program.cs。

InitializeComponent();
shellWindows = new SHDocVw.ShellWindows(); //Global var
shellWindows.WindowRegistered += shellWindows_WindowRegistered; <-- This is the error

我在谷歌上搜索了一整天,似乎没有人有这个问题,它只发生在远程计算机上。这些计算机配置上是否存在导致此问题的内容?shdocvw 库有问题吗?

4

1 回答 1

0

原来这实际上是 Internet Explorer 本身的问题。

我们想阻止用户在这些计算机上做很多事情,我们对 IE 的摆弄有点过分,不得不安装一个特殊版本来阻止很多事情。

我重建了机器,测试了服务,它工作正常。

于 2016-02-29T22:18:04.347 回答