Fez Panda II - SD Card - Error in Constructor of PersistantStorage

I have a problem when using such a simple code like this:

PersistentStorage SDCard = new PersistentStorage(“SD”);

When I built the code to deploy into my Fez Panda II, it thrown me an error of :

“The type ‘GHIElectronics.NETMF.USBHost.USBH_Device’ is defined in an assembly that is not referenced. You must add a reference to assembly ‘GHIElectronics.NETMF.System, Version=, Culture=neutral, PublicKeyToken=null’. c:\Documents and Settings.…\visual studio 2010\Projects\MFConsoleApplication2\MFConsoleApplication2\Program.cs”

I looked into the library and saw that there was three constructors for “PersistentStorage”.

One is “public PersistentStorage(GHIElectronics.NETMF.USBHost.USBH_Device usbDevice);”,

one is “public PersistentStorage(string DeviceID);”,

and the other one is “public PersistentStorage(GHIElectronics.NETMF.USBHost.USBH_Device usbDevice, byte massStorageLogicalUnit);”

However, in my library of “GHIElectronics.NETMF.USBHost” there was not a definition of class “USBH_Device”. But when I look on the GHI Electronics NETMF Library on the web site, there was. I downloaded the GHI NETMF v4.1from the support web page: Support – GHI Electronics.

I am looking for a solution for this problem. Any helps are appreciated. Thank you in advance!

See my reply on your last post. I suggested you take a look at the getting started ebook.

Welcome to the community.

If you want to use USB host, you’ll have to add:

using GHIElectronics.NETMF.USBHost;

However you don’t need it for SD card…

The persistent storage class is defined in another assembly:

so you have to use:

using GHIElectronics.NETMF.IO;

Thank you, Gus. I made it work by simply add a reference of “GHIElectronics.NETMF.System”. I confused before when you said to read about DLLs and how to add it because I thought that I have to access the .dll file and edit some codes, so that, I stucked in finding how to edit the .dll file. However, now I know what you mean, and happy with it. Thank you :-).

I did not add

using GHIElectronics.NETMF.USBHost;

I just add it into the reference to have a look what inside are. However, I know my problem now and I solved it. Thank you for giving me a hint.