I have been using the ManagementEventWatcher in the past few months to watch for new processes starting, and it has worked without any issues. However, I just recently tried my app again, and it seems that the events for a new process are no longer getting called.
Here is the sample code:
var startWatch = new ManagementEventWatcher(new WqlEventQuery("SELECT * FROM Win32_ProcessStartTrace"));
And the event:
private static void ProcessStart_EventArrived(object sender, EventArrivedEventArgs e)
{
Console.WriteLine("AppStarted");
}
I also tested this on another friend's machine (also Win 8.1) who had an old binary (which worked just fine in the past few months as well), and he is no longer receiving the events either.
The issue only seems to exist with the Win32_ProcessStartTrace because Win32_ProcessStopTrace works just fine and receives events when a process stops.
Has there been any windows updates lately that could perhaps interfere with this? My system's env has not changed since it last worked (aside form the win updates).