SdCard problem

When I try to read content of sd card, an exception is always throw (I’ve tried FAT and FAT32 but same error):

            _sdCardController = SdCardController.GetDefault();
            var drive = FileSystem.Mount(_sdCardController);
            _bMounted = true;
            _driveInfo = new DriveInfo(drive.Name);
            Debug.WriteLine(_driveInfo.TotalFreeSpace + "/" + _driveInfo.TotalSize);

            // Get root directory
            var rootDirectory = _driveInfo.RootDirectory;
           var dirs = rootDirectory.GetDirectories(); // This line always throws an exception

What device?

Sorry to forget this important information: FEZ Spider II (G120E), version of TinyClr 0.12.0 (of course because sd Card !)

var dirs = rootDirectory.GetDirectories();

Confirm there is a bug with this function.

1 Like

@Dat_Tran Thanks for confirmation. Is there a workaround please ?

1 Like

Unfortunately, no workaround for now.

You may use the path directly till next release.

@Dat_Tran It seems to be same problem with GetFiles() function.

1 Like

Just added to issue list. Thanks for help us to find out these bugs.