[Mono-dev] Process.Responding giving wrong value

Chanaka Munasinghe chanakam2000 at gmail.com
Sun Jan 16 10:28:58 EST 2011


I am using Mono 2.6.7 on Ubuntu 10.10. I want to periodically check whether
a process is running normally or not.
For that I try to use

Process p = Process my_process = Process.GetCurrentProcess();

and in a Timer checking p.Responding

However strangely p.Responding is always return false.
For example see following code  & Outputs


Code
====

using System;
using System.Diagnostics;

namespace CurrentProcessInfo
{
  class Program
  {
      static void Main(string[] args)
      {
          //First lets get our parent process
          Process my_process = Process.GetCurrentProcess();

          // Now we'll spit out some pertinent info on our process
          // Only a handful of the properties are referred to here,
          // see the docs for the full list
          Console.WriteLine("\nThe current process has the following
attributes:");
          Console.WriteLine("------------------------------------");
          Console.WriteLine("Process Name: " + my_process.ProcessName);
          Console.WriteLine("Window Title: " + my_process.MainWindowTitle);
          Console.WriteLine("Running on: " + my_process.MachineName);
          Console.WriteLine("Priority: " +
my_process.PriorityClass.ToString());
          Console.WriteLine("Responding: " + my_process.Responding);
          Console.WriteLine("Virtual Memory: " +
my_process.VirtualMemorySize64);
          Console.WriteLine("------------------------------------");
      }
  }
}


Outputs
========

The current process has the following attributes:
------------------------------------
Process Name: test
Window Title: null
Running on: localhost
Priority: Normal
Responding: False
Virtual Memory: 46956544
------------------------------------

What is going wrong ?
Thank you !


~~~~~~~~~~~~~~~~~~~
CHANAKA ARUNA MUNASINGHE
~~~~~~~~~~~~~~~~~~~

blog: http://status-chanaka.blogspot.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20110116/8dc5c688/attachment.html 


More information about the Mono-devel-list mailing list