根据list of available namespaces in a PCL project ,包含 System.Xml
。但是,在引用 System.Xml 命名空间内的 XmlTextReader
时出现编译错误。
我的目标是 .NET 4.0 + Silverlight 5 (Profile14)。我还尝试了 .NET4.0.3 + SL (Profile19) 和 .NET 4.5 + SL (Profile24),都一样。
XmlTextReader
是否应该在 PCL 中可用,如果不是,我在哪里可以找到可用类和不可用类的明确列表?
最佳答案
它不是,但您可以改用 XmlReader.Create()
。顺便说一句,这是推荐的解决方案for full .Net too :
Note
Starting with the .NET Framework 2.0, we recommend that you create XmlReader instances by using the XmlReader.Create method to take advantage of new functionality.
像往常一样,有一个 a tool for that .和 here是一个简短的介绍。
关于c# - 可移植类库是否支持 XmlTextReader?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21836027/