Here https://learn.microsoft.com/en-us/windows/uwp/files/access-the-sd-card#requirements-for-accessing-files-on-the-sd-card the documentation tells
You also have to register to handle the file extensions associated with the type of media that you want to access.
So you have to go to package.appxmanifest and register the .txt extension:
- double click on Package.appxmanifest
- go in Declaration section
- under "Available Declarations" select "File Type Associations" and Click Add
- fill "Name" (no spaces)
- fill "File type" with .txt
- Save
- Rebuild
After file extension registration the code below works for me
StorageFolder externalDevices = KnownFolders.RemovableDevices;
try
{
StorageFile storageFile = await externalDevices.GetFileAsync(@"F:\log\my item.txt");
}
catch (Exception e)
{
// handle exception
}
broadFileSystemAccess is not needed.