Main Site Documentation

System.InvalidOperationException with PersistentStorage("SD")


#1

I’m sorry, I need some help with the followed error message :
System.InvalidOperationException when I use :
MaCarteSD = new PersistentStorage(“SD”);

I tried with different SD cards, with Fat 16 and Fat 32 but it doesn’t change anithing.
I use the 4.2.11.1 version with the Spider card, the SD Card 1.4 module and T35 1.3 display
I use visual studio express 2010 on windows XP pro

Here is my code :

public partial class Program
{
private static PersistentStorage MaCarteSD;
private static VolumeInfo MonVolumeInfo;

    // This method is run when the mainboard is powered up or reset.   
    void ProgramStarted()
    {
        display_T35.SimpleGraphics.Clear();
        display_T35.SimpleGraphics.DisplayText("Début du programme...", Resources.GetFont(Resources.FontResources.small), GT.Color.Gray, 0, 0);

        if (PersistentStorage.DetectSDCard())
        {
            MaCarteSD = new PersistentStorage("SD");
        }
        MaCarteSD.MountFileSystem();
        MonVolumeInfo=VolumeInfo.GetVolumes()[0];
        display_T35.SimpleGraphics.DisplayText(MonVolumeInfo.FileSystem, Resources.GetFont(Resources.FontResources.small), GT.Color.Gray, 0, 0);

    }
}

I would be happy if somebody could help me!


#2

Try simple app with just the card don’t plug any other modules.