G
Guest
Hi,
We have a C# application running as a Windows Service. Once the service is
installed and a start is done on the service, the process will block when
accessing information about the current process. The example below placed in
the OnStart of a class inheriting from ServiceBase will hang on the
proc.ProcessName line.
using(System.Diagnostics.Process proc =
system.Diagnostics.Process.GetCurrentProcess())
{
return proc.ProcessName; // This line will hang long enough to prevent
the service from starting for timeout reason.
}
This hanging issue seems to happen only once in a while. Usually, the first
startup of the service will hang and timeout. The second startup will start
ok, the third will timeout and so on.
Is there a workaround or a fix for this issue?
Environment information:
OS : WinXP SP1
..NET: 1.1 SP1
Thanks!
Simon
We have a C# application running as a Windows Service. Once the service is
installed and a start is done on the service, the process will block when
accessing information about the current process. The example below placed in
the OnStart of a class inheriting from ServiceBase will hang on the
proc.ProcessName line.
using(System.Diagnostics.Process proc =
system.Diagnostics.Process.GetCurrentProcess())
{
return proc.ProcessName; // This line will hang long enough to prevent
the service from starting for timeout reason.
}
This hanging issue seems to happen only once in a while. Usually, the first
startup of the service will hang and timeout. The second startup will start
ok, the third will timeout and so on.
Is there a workaround or a fix for this issue?
Environment information:
OS : WinXP SP1
..NET: 1.1 SP1
Thanks!
Simon