title: Writing (updating) string to IsolatedStorage does not work
body: <p>When the application is started an update check for a textfile is performed. If the version number of the remote file is higher than the local one, the remote file shall be saved to isolated storage and replace the current one. Unfortunately it doesn't work as expected. There's still the old file in the storage.</p>
  
  <pre><code>    public static bool WriteFileToIsolatedStorage(String content, String fileName)
      {
          bool result = false;
  
          MessageBox.Show(Leser.GetVersionInfo(content));
  
          IsolatedStorageFile store = IsolatedStorageFile.GetUserStoreForApplication();
          StreamWriter writer = new StreamWriter(new IsolatedStorageFileStream(fileName, FileMode.Truncate, store));
  
          try
          {
              writer.Write(content);
              writer.Flush();
              writer.Close();
  
              result = true;
          }
          catch
          {
              result = false;
          }
  
          return result;
      }
  </code></pre>
  
  <p>I tried several FileMode parameters like "Create" or "Truncate", but when the application is restarted, there is always an update available. There is no error while writing to the storage but the version number indicates that it didn't work properly.</p>
  
  <p>I have a text file in my project explorer with the data that should be updated as described above. At the beginning I check the storage for this file and if not found, it will be written to it. This works as expected. But the updated version is not written and I don't have a clue why not. </p>
  
  <p>SOLUTION: Writing works fine :) The problem was that I read the ressource file and not the file saved to IsolatedStorage</p>
  
  <pre><code>    public static String ReadFileContents(String file)
      {
          String content = String.Empty;
  
          var ResourceStream = Application.GetResourceStream(new Uri(file, UriKind.Relative));
          if (ResourceStream != null)
          {
              Stream myFileStream = ResourceStream.Stream;
              if (myFileStream.CanRead)
              {
                  StreamReader myStreamReader = new StreamReader(myFileStream);
                  content = myStreamReader.ReadToEnd();
              }
          }
  
          return content;
      }
  </code></pre>
  
  <p>Sorry guys!</p>