Posts

Showing posts with the label Process.Start

Donate

Process.Start() Error - An error occurred trying to start process. The specified executable is not a valid application for this OS platform.

Image
Good evening! I had an issue when opening PDF files using Process.Start() which is called in a ShowFile() method of the project. The code which isn't working is shown below. System.Diagnostics.Process.Start(Path.Combine(myDocumentsPath, fileName)); The solution for that is to pass a ProcessStartInfo() object in the Start() parameter. And then set UseShellExecute property of the ProcessStartInfo object to true. The modified code that is working is shown below. System.Diagnostics.Process.Start( new ProcessStartInfo(Path.Combine(myDocumentsPath, fileName)) { UseShellExecute = true }); Output

Donate