PC Review


Reply
Thread Tools Rate Thread

Application hang calling System.Diagnostics.Process.GetCurrentProcess()

 
 
Heiko Weiss
Guest
Posts: n/a
 
      19th Jan 2005
Hi all,

when calling System.Diagnostics.Process.GetCurrentProcess() my application
hangs.
Not every time, but sometimes.

Any suggestions ?

TIA

Heiko

 
Reply With Quote
 
 
 
 
Steven Cheng[MSFT]
Guest
Posts: n/a
 
      20th Jan 2005
Hi Heiko,

From your description, your application will hang randomly when calling the
System.Diagnostics.Process.GetCurrentProcess(). BAsed on my experience,
this is likely a program specific issue. Where and when do you invoke the
call in your application and is there anything else in your application's
context may cause this?

In addition, the System.Diagnostics.Process.GetCurrentProcess just use
Platform Invoke to call the win32 GetCurrentProcessId method to obtain the
current processId and construct a new Process object.

[DllImport("kernel32.dll", CharSet=CharSet.Auto)]
public static extern int GetCurrentProcessId();

So you can also try using the PInvoke to call the unmanaged API directly
instead to see whether the problem still remains. Anyway, I think you can
try make a simple repro program so as to isolate the problem in a more
clear context.

Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Error after calling System.Diagnostics.Process.GetCurrentProcess().StartTime Matthew Lock Microsoft C# .NET 1 21st Feb 2007 10:29 AM
what permissions does a windows service need to execute another process? System.Diagnostics.Process process = System.Diagnostics.Process.Start(info); just local administrator? any specific permitions? Daniel Microsoft Windows 2000 Networking 1 13th Apr 2006 08:58 AM
what permissions does a windows service need to execute another process? System.Diagnostics.Process process = System.Diagnostics.Process.Start(info); just local administrator? any specific permitions? Daniel Microsoft Dot NET Framework 1 13th Apr 2006 04:56 AM
what permissions does a windows service need to execute another process? System.Diagnostics.Process process = System.Diagnostics.Process.Start(info); just local administrator? any specific permitions? Daniel Microsoft Windows 2000 0 12th Apr 2006 11:47 PM
System.Diagnostics.Process.GetCurrentProcess().ProcessName =?Utf-8?B?Ry5Sb2VsYW50?= Windows XP Embedded 1 17th Oct 2004 10:28 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:34 PM.