我收到错误 system.xml.xmldictionaryreader does not contain a definition for the VS2010 Express for Windows phone 上的“CreateTextReader”。该代码用于网页,它可以工作,然后我复制到我的手机应用程序中。我添加了“System.Runtime.Serialization”和“使用 System.xml”作为参考。有人会告诉我如何解决这个问题。谢谢。
有类使用:
using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.IO;
using System.Xml.Serialization;
using System.Runtime.Serialization;
using System.Collections.Generic;
using System.Xml;
using System.Text;
using System.IO.IsolatedStorage;
public static T Deserializer<T>(Stream s)
{
//Get results
var ser = new DataContractSerializer(typeof(T));
var reader = XmlDictionaryReader.CreateTextReader(s,
new System.Xml.XmlDictionaryReaderQuotas());
ser = new DataContractSerializer(typeof(T));
var deserializedItem = (T)ser.ReadObject(reader, true);
reader.Close();
return deserializedItem;
}
#endregion