我正在编写一个使用独立存储概念的简单wp7应用程序。我可以成功地完成应用程序,但当尝试测试它是否正常工作时,我得到一个错误,指出"abc.xml“文件在zap中丢失。abc.xml是使用以下代码创建的:
using (var store = IsolatedStorageFile.GetUserStoreForApplication())
{
using (var fs = store.OpenFile("abc.xml", FileMode.OpenOrCreate, FileAccess.ReadWrite))
{
var root = new XElement("User");
var Mobile_Number = new XElement("Mobile_NUmber", txtMobNum.Text);
var Sec_Ques = new XElement("Sec_Ques", secQues);
var xDoc = new XDocument();
root.Add(Mobile_Number, Sec_Ques);
xDoc.Add(root);
xDoc.Save(fs);
fs.Close();
}
}如果我将abc.xm添加到解决方案中,错误就会被清除,但我不认为这是正确的方法。有人能帮帮我吗?先说声谢谢
发布于 2011-04-26 13:48:13
你的问题已经回答了here。
发布于 2011-04-26 13:24:22
在应用程序的一次运行中在独立存储中创建的任何文件都不会被认为是要部署到其他设备的应用程序的一部分。
如果您有要随应用程序一起提供的文件,则应将其显式包含在项目中。
https://stackoverflow.com/questions/5786241
复制相似问题