c# - 可移植类库是否支持 XmlTextReader?

标签 c# .net xml cross-platform portable-class-library

根据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/

相关文章:

java - 如何使用 SAX 方法在 java 中解析 xml 文档

c# - 在 C# 中移动图像

c# - .NET 可以加载和解析等效于 Java Properties 类的属性文件吗?

c# - 启动时不发生 Excel VSTO NewWorkbook 事件

c# - 使用 "return"时如何在 block 外访问任何变量?

.net - 设计 WCF 服务器以实现低延迟

c# - 接口(interface)属性的内部修饰符

c# - 我应该手动编码 ADO.Net 数据库访问吗?

python - python 中的 Xml 具有不平衡/不均匀的元素/标签

java - JAXB:将 XML 标记放在抽象类上