I am opening a file using the OpenFileDialog in c# and I am noticing it is taking between 20-40 seconds to load my file and clear the dialog.
Here is my sample code
I also had this problem when I want to open a example.url file with file open dialog. It takes 0-10 seconds. Then I find out that this has something todo with the file type association (*.url) When I changed the association from default web browser to notepad++ the problem was gone. But I this was no solution for me, because when somebody clicked on a example.url, the default browser should open this file. To solve this I added DereferenceLinks = false
.
OpenFileDialog ofd = new OpenFileDialog
{
...
DereferenceLinks = false
};
For me this solution works perfect