Willy,
I'm running in XP SP2 (.NET 1.1.4322)
I'm running as a local user on my laptop. Only 1 user on the machine.
One thing to note: if I use this code:
private void TestFunction()
{
Process proc;
proc = Process.GetCurrentProcess();
string procName = proc.ProcessName; <-- HANGS HERE
Console.WriteLine(procName);
}
The "proc =" assignment returns as expected. But if I try to examine
the properties of "proc" (in the debugger), "proc" it looks like an
uninitialized object.
Then the "procName=" line hangs (or appears to hang).
I still need to try elimintating all the unnecessary processes and
waiting longer, (as suggested by Nicholas) to see if that allows the
app to work.
But I don't understand why the "proc=" line return what appears to be
an improperly init'd object.
Thanks for your help.
-tomas
Hello All,
I'ma having trouble getting GetCurrentProcess() to work properly.
What I'm trying to accomplish is list all running processes. But my
call get GetProcesses() hangs.
While testing things out I found that the tiny program listed below
hangs as well.
Am I missing something?
-tomas
//---- This app hangs ----
using System;
using System.Diagnostics;
namespace proctest
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
Console.WriteLine(Process.GetCurrentProcess().ProcessName);
}
}
}
// -- What's wrong with this code?
This tiny program should return within seconds. What version of XP (SP)
and
.NET are you running?
Are you running this as domain user or as a local user, how many user
tokens
do you have in you account group?
Willy.