When double-clicking on a file with an unknown file type, windows will bring up a window that allows me to select which application I want to open the file with.
I am trying to open files in my application using the following code and I was getting the same result until recently
var startInfo = new ProcessStartInfo(document.DownloadPath);
startInfo.UseShellExecute = true;
Process.Start(startInfo);
I don't know when it stopped working, as I moved on to other parts of the application, but now I get the following error when trying to open a file with an unknown extension.
System.ComponentModel.Win32Exception (1155): No application is associated with the specified file for this operation.
at System.Diagnostics.Process.StartWithShellExecuteEx(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
How can I get the same experience when opening with my application or actually double-clicking on the file?