The only time I got the error that you mention in your first post is if I try to run this code using the emulator.
#### Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (1) ####
#### Test.Program::Main [IP: 0007] ####
A first chance exception of type ‘System.NotSupportedException’ occurred in MFConsoleApplication1.exe
An unhandled exception of type ‘System.NotSupportedException’ occurred in MFConsoleApplication1.exe
I ran your code in reply 4 exactly as you have it there and I did not get any errors. It read the filesystem and listed the files in the main directory.
For this example you posted, make sure you have the following assemblies:
I ran the code that you linked to in your first post using a Panda II template and modified the code as follows:
public class Program
public static void Main()
// SD Card is inserted
// Create a new storage device
PersistentStorage sdPS = new PersistentStorage("SD");
// Mount the file system
// Assume one storage device is available, access it through
// Micro Framework and display available files and folders:
Debug.Print("Getting files and folders:");
string rootDirectory =
string files = Directory.GetFiles(rootDirectory);
string folders = Directory.GetDirectories(rootDirectory);
Debug.Print("Files available on " + rootDirectory + ":");
for (int i = 0; i < files.Length; i++)
Debug.Print("Folders available on " + rootDirectory + ":");
for (int i = 0; i < folders.Length; i++)
Debug.Print("Storage is not formatted. Format on PC with FAT32/FAT16 first.");
//public static void Main()
// // Blink board LED
// bool ledState = false;
// OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, ledState);
// while (true)
// // Sleep for 500 milliseconds
// // toggle LED state
// ledState = !ledState;
Make sure these assemblies are pressent:
Again I did not get any errors and the filesystem was read as it was read in the reply 4 test program.
I tested these programs on two different cards:
Kingston 2GB MicroSD
Dane-Elec 4GB MicroSD HC
This is the capabilities of my current version of Panda II:
ClrInfo.clrVendorInfo: Microsoft Copyright © Microsoft Corporation. All rig
SolutionReleaseInfo.solutionVendorInfo: GHI Electronics, LLC
SoftwareVersion.BuildDate: Jun 24 2011
I ran the code as posted in Reply 13 and added the appropriate assemblies and the SD Card did indeed format. I placed the card on my laptop and it was blank. I then put some files on the card and reran one of the other SD Card reading test programs from post 1 and reply 4 and was able to read the file system.
Try some of these solutions and see if they work as I have described them.
[quote]#### Exception System.NotSupportedException - CLR_E_NOT_SUPPORTED (5) ####
I have the same problem on the Panda II.
I tried to format the SD with the Panda II and with Windows 7 - i also used two different 2GB SD Cards.[/quote]
Make sure that you are not running in emulation mode by going to the Solution Manager and double click on properties. On the properties page select the .Net Micro Framework tab and select Transport: USB… USBizi_USBizi should automatically be there.