我收到错误system.xml.xmldictionaryreader在VS2010 Express for Windows手机上不包含'CreateTextReader'的定义。代码用于网页,它可以工作,然后我复制到我的手机应用程序。我添加了“System.Runtime.Serialization”和“using 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