Today I found very annoying and strange bug (or, may be, MS call it "feature"
). Seems like directories on isf can hold 1024 files only
Try code below:
Random rnd = new Random();
using (var isf = IsolatedStorageFile.GetUserStoreForApplication())
byte data = new byte;
for (int i=0; i<1025; i++)
string fileName = "test\\" + i.ToString("D4") + ".bin";
using (IsolatedStorageFileStream fs = new IsolatedStorageFileStream(fileName, FileMode.Create, isf))
fs.Write(data, 0, data.Length);
After loop completed, resulting directory "test" will be empty! But change i<1024 and you'll get all yours 1024 files...
Tested on emulator and HTC Surround, same results. Can't find any documentation about this limitation... Shame on you, MS!
Update: another strange behavior ('cause of this bug) - if you already have 1024 files and try to add one more, the whole directory content is "magically" disappear
But exception isn't thrown...