Search code examples
windows-phone-7isolatedstorage

Cannot delete particular file


I am developing gallery viewer app. App will fetch the image file from Isolated Storage and will show in an image control. Most of the things are already setup and working fine.

Now images are stored in folders which act as album and user can delete the whole album. I tested with many many folders with assorted images and delete works fine. But I see that when there is a particular image file of name "XXXX.jpg", it doesn't get deleted. Although all the images from folder are shown in image control. That file doesn't gets deleted, and an exception is thrown "ArgumentUnhandledException". I tried after renaming the file but earth didn't move.

Also, for testing purposes I am transferring folders(with images in it) using "Windows Phone Device Manager". I know it is not official to use it, but it makes testing easy. Also peculiar thing is that "Windows Phone Device Manager" also cannot delete that particular file, although I dumped that file in app's isolated storage using "Windows Phone Device Manager". So I think that there is some problem with that file.

How can I delete the file. And if I cannot, how can I know it before hand that some files cannot be dealt with properly and should not be dumped in Isolated storage.Here is that file. File is inside zip file. I think file is required and not not just uploading image to a image hosting site. Please take a look. Also try not to look over the content of image file, that's only random file which is not working and I want to know why.


Solution

  • I found that file was marked read-only and was causing problem when a delete attempt was made. Removing read-only solves the problem.