Windows Service stops triggering monitoring event for starting process

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Developer111
    New Member
    • Apr 2010
    • 28

    Windows Service stops triggering monitoring event for starting process

    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:-

    WithEvents Watcher As ManagementEvent Watcher

    Watcher = New ManagementEvent Watcher(New WqlEventQuery(" Select * From Win32_ProcessSt artTrace"))

    AddHandler Watcher.EventAr rived,AddressOf ManagementWatch er_StartEventAr rived

    Watcher.Start()

    The problem which I have been facing is that the application works fine in case of service installation/un-installation, begin and stop, at its first run i.e. systems startup but stops triggering monitoring event for starting processes, if we un-install and then again install and begin the service after span of some time (5-10 Mins). Moreover, the service is responding/triggering all remaining events, except the aforementioned monitoring event.

    The odd behavior of the service will remain to continue until and unless I reboot my computer.

    Please help me in this regard.
Working...