✅ Folder selector can not select folder from phone
Hi there,
as the title suggests i am unable to select a folder on my phone programmatically. For some reason the
OK
button is also grayed out.
13 Replies
Your phone is probably connected using MTP, which is not a real filesystem, but rather a protocol like FTP.
I’m not sure why that dialog would show MTP devices anyways.
It indeed connects through MTP. Do you have some keys on which i can search or have some tips to tackle this?
I’m afraid not. You’ll have to look both how to get the folder dialog to permit MTP, and also might need to add MTP support to your app in some way.
Also, fwiw, this is the older folder dialog, there’s a newer one that might handle MTP better. What version of .NET are you targeting?
I guess youre looking for this:
I use WPF.
I could choose between WPF Application and a WPF .NET Application, so i went for the second. Didnt know if that choice had much consequences.
$newproject
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework.
.NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended.
https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
I believe.NET 6 (7?) switched to the new dialog.
Currently we’re on .NET 8.
i should have seen this image earlier 🤣 . I clicked on the one with
NO
Let me create a new project and paste the stuff over.To be honest.
The Framework templates really should be hidden or at least show a warning.
I created a new project. I should now use OpenFolderDialog right?
Dipesh Kumar
.NET Blog
WPF File Dialog Improvements in .NET 8 - .NET Blog
Announing OpenFolderDialog control and other file dialog properties in WPF in .NET 8.
this is better haha! I sadly cant find the MTP
yeah im done with this stuff 🤣
spend nearly 5 hours on this while i also could copy paste stuff myself