Note that there are some explanatory texts on larger screens.

plurals
  1. POIsolatedFileStorage XML Reading Crash
    primarykey
    data
    text
    <p>Ok so, basically my problem is with reading and XML file from IsolatedFileStorage. I'll go through the process that leads to my error and then I'll list the relevant code and XML file.</p> <ol> <li>On the first execution it recognises that the file does not exist - it therefore creates the file in IsolatedFileStorage</li> <li>On the second execution it can now see that the file does exist and so it loads the XML file</li> <li>On the third execution it can see that it exists - but it throws an XML error</li> </ol> <p>I cannot for the life of me find a solution to it (link to other discussion on MSDN <a href="http://social.msdn.microsoft.com/Forums/en-US/mktplace/thread/b9739f27-9be5-4450-a391-74151d0e68ce/" rel="nofollow">here</a>)</p> <p>So the code for reading/creating the XML file in IsolatedFileStorage is as follows:</p> <pre><code>try { /*********************** * CHECK THE SETTINGS ********************/ if (store.FileExists("AppSettings.xml")) { streamSettings = new IsolatedStorageFileStream("AppSettings.xml", System.IO.FileMode.Open, store); DebugHelp.Text = "AppSettings.xml exists... Loading!"; streamSettings.Seek(0, System.IO.SeekOrigin.Begin); xmlDoc = XDocument.Load(streamSettings, LoadOptions.None); } else { streamSettings = new IsolatedStorageFileStream("AppSettings.xml", System.IO.FileMode.Create, store); DebugHelp.Text = "AppSettings.xml does not exist... Creating!"; xmlDoc = XDocument.Load("AppSettings.xml", LoadOptions.None); } if (xmlDoc != null) xmlDoc.Save(streamSettings); } catch (Exception e) { DebugHelp.Text = e.ToString(); } finally { streamSettings.Close(); } </code></pre> <p>And the related XML file is as follows:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt; &lt;Settings&gt; &lt;/Settings&gt; </code></pre> <p>Extremely advanced I know - however it throws the following error (<a href="http://i.stack.imgur.com/Ll7Ut.png" rel="nofollow">here</a>) and you can find the full error text at the bottom of the Social.MSDN page.</p> <p>Please help - I have been looking for a solution (as the one on the social.msdn site didn't work) for about 2 weeks now.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload