Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / New Users / May 2004

Tip: Looking for answers? Try searching our database.

GetProcesses() hang

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Floyd Burger - 03 May 2004 20:51 GMT
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?

Signature

Floyd Burger

Phil Wilson - 03 May 2004 21:41 GMT
See if this helps:
http://support.microsoft.com/default.aspx?scid=kb;en-us;823642
Signature

Phil Wilson [MVP Windows Installer]
----

> I have a real simple C# console project, consisting of this:
>
[quoted text clipped - 19 lines]
>   I'm administrator on all tested systems. VS.NET 2003, .NET Framework
> 1.1.4322.  Any ideas?
Floyd Burger - 03 May 2004 22:32 GMT
Thanks, but I forgot one piece of info, I'm running XP Pro.

Signature

Floyd Burger

> See if this helps:
> http://support.microsoft.com/default.aspx?scid=kb;en-us;823642
[quoted text clipped - 21 lines]
> >   I'm administrator on all tested systems. VS.NET 2003, .NET Framework
> > 1.1.4322.  Any ideas?
Phil Wilson - 03 May 2004 23:31 GMT
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.
Signature

Phil Wilson [MVP Windows Installer]
----

> Thanks, but I forgot one piece of info, I'm running XP Pro.
>
[quoted text clipped - 25 lines]
> > >   I'm administrator on all tested systems. VS.NET 2003, .NET Framework
> > > 1.1.4322.  Any ideas?
Floyd Burger - 04 May 2004 00:29 GMT
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.

Signature

Floyd Burger

> 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
[quoted text clipped - 31 lines]
> > > >   I'm administrator on all tested systems. VS.NET 2003, .NET Framework
> > > > 1.1.4322.  Any ideas?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.