title: Access is denied. When i try CRUD XML files using XAML for windows 8
body: <p>It doesn't throw this error everytime, thats what makes it strange.
  I got 50% chance that it works.</p>
  
  <p>This is how I call the save method</p>
  
  <pre><code>private async void btnSave_Click(object sender, RoutedEventArgs e)
  {
      await settings.WriteSettings(settings);
  }
  </code></pre>
  
  <p>And this is the method itself</p>
  
  <pre><code>public async Task WriteSettings(Settings settings)
  {
      var ser = new System.Xml.Serialization.XmlSerializer(typeof(Settings));
      var writer = new StringWriter();
      ser.Serialize(writer, settings);
      dom.LoadXml(writer.ToString());
      StorageFolder sf = ApplicationData.Current.LocalFolder;
      StorageFile st;
      st = await sf.CreateFileAsync(filename, CreationCollisionOption.ReplaceExisting); // here i get the error
      await dom.SaveToFileAsync(st);
  }
  </code></pre>
  
  <p>I hope you guys understand the problem and you can help me getting a solution</p>