GetProcesses() hang

F

Floyd Burger

I have a real simple C# console project, consisting of this:

using System.Diagnostics;

static void Main(string[] args)
{
Process[] processes = Process.GetProcesses();
// write all of the process info
foreach(Process p in processes)
Console.WriteLine(p.ProcessName + " : " + p.MainWindowTitle);
Console.ReadLine();
}

When I run it on my dev machine it hangs on the call to
Process.GetProcesses(). Task Manager shows 0% CPU and a steady 10,964 mem
usage while it's hung. There are 40 tasks running, including devenv,
newsreader, Norton Internet Security, etc. When I run this little test on
other computers (most have more tasks running), GetProcesses() returns
almost immediately and all processes are listed. On my dev machine this
console project has been running for the past hour, and it still hasn't
returned from GetProcesses().
I'm administrator on all tested systems. VS.NET 2003, .NET Framework
1.1.4322. Any ideas?
 
F

Floyd Burger

Thanks, but I forgot one piece of info, I'm running XP Pro.

--
Floyd Burger


Phil Wilson said:
See if this helps:
http://support.microsoft.com/default.aspx?scid=kb;en-us;823642
--
Phil Wilson [MVP Windows Installer]
----
Floyd Burger said:
I have a real simple C# console project, consisting of this:

using System.Diagnostics;

static void Main(string[] args)
{
Process[] processes = Process.GetProcesses();
// write all of the process info
foreach(Process p in processes)
Console.WriteLine(p.ProcessName + " : " + p.MainWindowTitle);
Console.ReadLine();
}

When I run it on my dev machine it hangs on the call to
Process.GetProcesses(). Task Manager shows 0% CPU and a steady 10,964 mem
usage while it's hung. There are 40 tasks running, including devenv,
newsreader, Norton Internet Security, etc. When I run this little test on
other computers (most have more tasks running), GetProcesses() returns
almost immediately and all processes are listed. On my dev machine this
console project has been running for the past hour, and it still hasn't
returned from GetProcesses().
I'm administrator on all tested systems. VS.NET 2003, .NET Framework
1.1.4322. Any ideas?
 
P

Phil Wilson

GetProcesses relies on the Perfmon counter stuff, so it's still worth
looking at your system to see if they're ok, even it's just something as
basic as running Perfmon, just to see if Perfmon can list processes ok.
--
Phil Wilson [MVP Windows Installer]
----
Floyd Burger said:
Thanks, but I forgot one piece of info, I'm running XP Pro.

--
Floyd Burger


Phil Wilson said:
See if this helps:
http://support.microsoft.com/default.aspx?scid=kb;en-us;823642
--
Phil Wilson [MVP Windows Installer]
----
Floyd Burger said:
I have a real simple C# console project, consisting of this:

using System.Diagnostics;

static void Main(string[] args)
{
Process[] processes = Process.GetProcesses();
// write all of the process info
foreach(Process p in processes)
Console.WriteLine(p.ProcessName + " : " + p.MainWindowTitle);
Console.ReadLine();
}

When I run it on my dev machine it hangs on the call to
Process.GetProcesses(). Task Manager shows 0% CPU and a steady 10,964 mem
usage while it's hung. There are 40 tasks running, including devenv,
newsreader, Norton Internet Security, etc. When I run this little
test
 
F

Floyd Burger

It's amazing what one forgets, I completely forgot about perfmon.
Perfmon.exe never runs, and the mmc plugin never gets past loading
perfmon.msc.
I went through the registry (under
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services), searched for
"performance" and renamed all of the counter dlls to *.dll_, then re-ran
PerfMon. It came up fine. Then I went though each dll that I renamed and
renamed it back to the *.dll original name, trying PerfMon after each one.
Through this, I found that the MSFtpsvc and W3SVC counters (in ftpctrs2.dll
and w3ctrs.dll) were the ones that are causing the problem. Without those,
PerfMon, and my little sample, work great. Now, to find out why those are
broke...<g>

Phil, thanks for your help, I couldn't have found the problem without it.

--
Floyd Burger


Phil Wilson said:
GetProcesses relies on the Perfmon counter stuff, so it's still worth
looking at your system to see if they're ok, even it's just something as
basic as running Perfmon, just to see if Perfmon can list processes ok.
--
Phil Wilson [MVP Windows Installer]
----
Floyd Burger said:
Thanks, but I forgot one piece of info, I'm running XP Pro.

--
Floyd Burger


Phil Wilson said:
See if this helps:
http://support.microsoft.com/default.aspx?scid=kb;en-us;823642
--
Phil Wilson [MVP Windows Installer]
----
I have a real simple C# console project, consisting of this:

using System.Diagnostics;

static void Main(string[] args)
{
Process[] processes = Process.GetProcesses();
// write all of the process info
foreach(Process p in processes)
Console.WriteLine(p.ProcessName + " : " + p.MainWindowTitle);
Console.ReadLine();
}

When I run it on my dev machine it hangs on the call to
Process.GetProcesses(). Task Manager shows 0% CPU and a steady
10,964
mem
usage while it's hung. There are 40 tasks running, including devenv,
newsreader, Norton Internet Security, etc. When I run this little
test
on
other computers (most have more tasks running), GetProcesses() returns
almost immediately and all processes are listed. On my dev machine this
console project has been running for the past hour, and it still hasn't
returned from GetProcesses().
I'm administrator on all tested systems. VS.NET 2003, .NET Framework
1.1.4322. Any ideas?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top