title: Why does Isolated storage not delete the last two temporary files when exiting on a Windows Phone 7?
body: <p>I have written an application that uses Isolated storage store data that I want to clear out on a periodic basis when it gets old.  I have written a function that is called from Closing that checks the isolated storage for old data and deletes it.  </p>
  
  <p>This routine will delete everyfile that it is supose too except the last two files in the directory.  When I debug the code I can see it execute the DeleteFile method on those files.  I even when as far as checking right after the call to DeleteFile to see if the file still exists.  According to the debugger it does not.  </p>
  
  <p>Yet when the appication starts up again the old data is for those last files is still in isolated storage.  Thinking that it may be a race condition I put a Thread.sleep(1000) after the delete routeines.  </p>
  
  <p>The phone does not honor this delay and exits immediately after executing the delte code.  I could not find a flush command that would be related to DeleteFile as I don't have a reference to a stream at that point.</p>
  
  <p>Has anyone else found this or something similar?  Is there a magic flush method I am missing or is this a defect in the phone IsolatedStorage implementation?</p>