G
Guest
I have a simple snippet of code that loops through a process() and writes to
the eventlog the contents of the Responding property. I have run this in a
console app and it returns False as it should. I have moved this code to a
windows service but it will always return true. The code is:
Dim proc() As Process = Process.GetProcessesByName(_processToMonitor)
Dim p As Process
For Each p In proc
EventLog.WriteEntry(p.ProcessName & _
" id: " & p.Id & _
" full path: " & p.Modules(0).FileName & _
" responding?:" & p.Responding.ToString)
Next
I have tried to change the Account used for the service but always get the
same results (True). I have moved this code to an .exe but I am curious to
why it runs differently in a windows service.
Regards,
David
P.S. If someone wants to test this I have found the easiest why to get an
application to a Not Responding status is to open a large file with notepad.
the eventlog the contents of the Responding property. I have run this in a
console app and it returns False as it should. I have moved this code to a
windows service but it will always return true. The code is:
Dim proc() As Process = Process.GetProcessesByName(_processToMonitor)
Dim p As Process
For Each p In proc
EventLog.WriteEntry(p.ProcessName & _
" id: " & p.Id & _
" full path: " & p.Modules(0).FileName & _
" responding?:" & p.Responding.ToString)
Next
I have tried to change the Account used for the service but always get the
same results (True). I have moved this code to an .exe but I am curious to
why it runs differently in a windows service.
Regards,
David
P.S. If someone wants to test this I have found the easiest why to get an
application to a Not Responding status is to open a large file with notepad.