Q:

Cannot get the list of running/current processes?

I'm trying to get the list of running processes / sessions on my computer with Win7 using the following code, which is found in internet. However it doesn't work? I have not got any compile errors.
namespace CurrentProcessesLister
{
   class Program
   {
      static void Main(string[] args)
      {
          Process[] runningProcesses = Process.GetProcesses();
          var currentSessionID = Process.GetCurrentProcess().SessionId; 
          Process[] sameAsthisSession = (from c in runningProcesses where c.SessionId ==    currentSessionID select c).ToArray(); 

          foreach (var p in sameAsthisSession) 
          { 
              Trace.WriteLine(p.ProcessName); 
          }
      }
  }
}

A:

" there is no output in the console "

Then replace
Trace.WriteLine(p.ProcessName); 

with 
Console.WriteLine(p.ProcessName); 

But if you then still don't see anything, it's time to start using the debugger. 

