Windows Phone 7 Operation not permitted on IsolatedStorageFileStream

MacStims

New Member
I'm working on a app that has a directory, and it pulls it in via XML from the web, writing it to a local XML file, and then reading it from there to display the contacts. I'm having issues with my IsolatedStorageFileStream not working, because the operation is not permitted. Here is my code:\[code\]IsolatedStorageFile isoStorage = IsolatedStorageFile.GetUserStoreForApplication(); IsolatedStorageFileStream file = isoStorage.OpenFile("Components/contacts.xml", FileMode.OpenOrCreate, FileAccess.Read); var reader = new StreamReader(file); XElement appDataXml = XElement.Load(reader); lstContacts.ItemsSource = from contact in appDataXml.Descendants("contact") select new ContactItem { ImageSource = contact.Element("Image").Value, FName = contact.Element("FName").Value, LName = contact.Element("LName").Value, Extension = contact.Element("Extension").Value, Email = contact.Element("Email").Value, Cell = contact.Element("Cell").Value, Title = contact.Element("TitleName").Value, Dept = contact.Element("deptName").Value, Office = contact.Element("officename").Value, ID = contact.Element("ID").Value };\[/code\]I can pull it directly from the internet and put it into the \[code\]lstContacts\[/code\], but I can't seem to even open the file to write it to the file(that way it's available offline). Here is my actual error put to a pastebin. This happens directly at \[code\]IsolatedStorageFileStream file = isoStorage.OpenFile("Components/contacts.xml", FileMode.OpenOrCreate, FileAccess.Read);\[/code\]Any help is greatly appreciated.
 
Back
Top