Process.Start and issues with psapi.dll
Posted on 2010-08-25
I have C# Windows form application that I have running on HP Thin Clients.
The application uses a COM interface to retrieve data from a server and occasionally the app will have connectivity issues requiring it to be restarted.
To solve this I included code that restarts the application using
but I started getting intermittent errors such as "This application failed to start because psapi.dll was not found. Re-installing the application may fix this problem."
I thought this may be caused by the app starting a new copy before the old was closed and so I changed the code to restart the terminal using
Process.Start("ShutDown", "-r -t 01 -f");
but the system will still hang with the same messages.
Reading through the net I found that Process.Start uses psapi.dll but I cannot work out why this issue is occurring or what I can do to avoid it. It is especially annoying as the error will only occur intermittently.
Any help would be appreciated