By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,968 Members | 1,410 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,968 IT Pros & Developers. It's quick & easy.

Windows Service stops triggering event for monitoring of starting process

P: 28
I am developing a Windows Service Application in (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:-
Expand|Select|Wrap|Line Numbers
  2. WithEvents Watcher As ManagementEventWatcher
  4. Watcher = New ManagementEventWatcher(New WqlEventQuery("Select * From Win32_ProcessStartTrace"))
  6. AddHandler Watcher.EventArrived,AddressOf ManagementWatcher_StartEventArrived
  8. Watcher.Start()
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.
Nov 23 '10 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.