Why does System.IO.Directory.Exists return false when viewing Mac path in .net Maui?

Viewed 33

I am building a .net Maui app which targets Mac Catalyst. I implemented a folder picker from @GeraldVersluis

Folder Picker .NET MAUI

When choosing the folder the following path is returned: pickedFolder = file:///Users/macminim1/Documents/Sorted%20Testing/

If I then use:

if (System.IO.Directory.Exists(pickedFolder))
{

}

The result is false. Obviously, the folder exists as I just chose it and I confirmed it's existence in the file system.

Thanks in advance!

1 Answers

You could direct to this folder in the Terminal and use the 'pwd' command, this should return you the correct path. I think 'file:://' is not correct

Related