I suspect my SD card file system has become corrupt. That is not the biggest problem here… the biggest issue is that if my application calls:
File.Delete(“filename”);
…then the application hangs. Not only does it hang but my debugger loses connection. And this is happening early enough in the boot process of my application that it prevents VS2015 from connecting to the target to download new code! I have to pull out MFDeploy to load a “hello world” application just to be able to re-attach the debugger to load new applications to test.
What makes this interesting is that if I call File.Exists(“filename”) or open a stream and read from the file then it all works great.
Does anyone have any ideas how I can write my code so it doesn’t lock up when trying to delete a file? Are there any functions I can call before to prevent this from happening? Is there any way to recover from this error without formatting the SD card?