1

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?

3
  • 1
    stackoverflow.com/questions/4726441/… Commented Mar 25, 2021 at 1:31
  • @HansPassant This will ask for all files. I only want it to ask for files that it is not sure of. My code used to work in .net framework apps that I have written. Not sure why it would not be working now on .net 3.1. Commented Mar 25, 2021 at 1:50
  • Possible duplicate of stackoverflow.com/questions/884012/… Commented Nov 7, 2022 at 14:06

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.