I am developing a Windows Service Application in VB.net (using WMI). The application monitors for occurrence (Start) of any new event/ process in Win32 environment. The code which I am using for handling this monitoring event is as under:-
	The problem which I am been facing is that the application works fine, at system startup, but stops triggering event for monitoring of starting processes, when I repeatedly un-install, then install and then start service, few times. Moreover, the service is responding/triggering all remaining events, except the aforementioned monitoring event.
The thing which I have also noticed is that WMI shows an error when we try to stop WMI service after above mentioned problem. The odd behavior of both services (i.e. my service and WMI) will remain to continue until and unless I reboot my PC.
Please help me in this regard.
Thanks in advance.
					Code:
	
WithEvents Watcher As ManagementEventWatcher
Watcher = New ManagementEventWatcher(New WqlEventQuery("Select * From Win32_ProcessStartTrace"))
AddHandler Watcher.EventArrived,AddressOf ManagementWatcher_StartEventArrived
Watcher.Start()
The thing which I have also noticed is that WMI shows an error when we try to stop WMI service after above mentioned problem. The odd behavior of both services (i.e. my service and WMI) will remain to continue until and unless I reboot my PC.
Please help me in this regard.
Thanks in advance.