question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

OpenFileDialog returns null if more than ~12 files are selected

See original GitHub issue

Platform: Windows 10, Avalonia 0.6.1

Hello! Given an OpenFileDialog initialized with AllowMultiple:

OpenFileDialog ofd = new OpenFileDialog(); 
ofd.AllowMultiple = true; 
 
string[] files = await ofd.ShowAsync(VisualRoot as Window); 

The OpenFileDialog returns null when selecting more than ~12 files, which is very limiting.

I don’t know much about the Windows API, but looking at SystemDialogImpl, this is probably coming from the 256 chars buffer. On Linux/Gtk3, the issue did not appear or the limit is bigger.

Maybe with AllowMultiple this buffer should be made far larger, or the API could expose this as a property?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
plulecommented, Jun 22, 2018

@CommonGuy Thank you for the fix!

0reactions
plulecommented, Apr 18, 2018

You’re right that’s the way to go, I also did not read well your first link that also dynamically resize the buffer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

C# OpenFileDialog - exception when no files are chosen
String.IsNullOrEmpty(fileToCheck )) check. Another way - just put the code around fileToCheck which is currently outside of openFileDialog.
Read more >
FileDialog returns null when attempting to open SMB address
Steps To Reproduce: 1.Run attached test case 2.Enter a network location into file dialog using SMB:// (for example SMB://servername/folder/filename.txt. You ...
Read more >
"Get-Content" from file, after using the OpenFileDialog
So, it seems that the file is being selected and assigned to that variable properly, but for some reason there is a problem...
Read more >
Update File Dialog Code to work with 32-bit AND 64-bit ...
I've updated my version of Microsoft Project 2019 from the 32-bit version to the 64-bit version. The code below does not open the...
Read more >
OpenFileDialog Class (System.Windows.Forms)
This class allows you to check whether a file exists and to open it. The ShowReadOnly property determines whether a read-only check box...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found