c starts the program error reporting solution using process.start

  • 2020-05-27 07:02:45
  • OfStack

Error message:


Unknown error (0xffffffff)
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start(String fileName, String arguments)
at ProcessStart.Form1.start()
[/code}
 Error situation :
 We found that most of the time, C# call Process.Start Nothing can go wrong. This error usually occurs when you use Local System When the account runs the program, for example we have 1 a windows Service, which is called by the service Process.Start When a new process is created, the new process and all of its children are created System The account is running. Then call Process.Start It's possible, just possible, that on so many of our machines 1 Machine running windows 2003 This error occurred on the server of. It may have something to do with the system setting. 
 Solutions: 
 Just change the code, set it ProcessStartInfo the UseShellExecute=false Can be 
[code]
ProcessStartInfo psi = new ProcessStartInfo();
psi.FileName = exepath;
psi.UseShellExecute = false;
psi.CreateNoWindow = true;
Process.Start(psi);


Related articles: