Win32_ProcessStartTrace的ManagementEventWatcher不再适用于Win 8.1

Dan*_*Dan 5 .net c# wmi

在过去的几个月里,我一直在使用ManagementEventWatcher来监视新流程的开始,并且它没有任何问题.但是,我刚刚再次尝试了我的应用程序,似乎新进程的事件不再被调用.

以下是示例代码:

   var startWatch = new ManagementEventWatcher(new WqlEventQuery("SELECT * FROM Win32_ProcessStartTrace"));
Run Code Online (Sandbox Code Playgroud)

事件:

private static void ProcessStart_EventArrived(object sender, EventArrivedEventArgs e)
{
            Console.WriteLine("AppStarted");
}
Run Code Online (Sandbox Code Playgroud)

我还在另一个朋友的机器(也是Win 8.1)上测试了这个机器,它有一个旧的二进制文件(在过去的几个月中也运行得很好),他也不再接收这些事件了.

这个问题似乎只存在于Win32_ProcessStartTrace中,因为Win32_ProcessStopTrace工作得很好,并在进程停止时接收事件.

最近是否有任何Windows更新可能会干扰这个?我的系统的env自上次工作以来没有改变(除了赢得更新).

小智 1

我遇到了这个问题。要修复此问题,您需要卸载 Windows 更新“kb3045999”。

去做这个:

  1. 打开 Windows 更新
  2. 点击“查看更新历史记录”
  3. 点击顶部的“已安装的更新”
  4. 向下滚动,直到看到“Windows 安全更新 (KB3045999)”
  5. 右键单击并卸载
  6. 重新启动计算机

然后问题应该得到解决。