C# - 可移植类库 "XmlElement does not exist in the namespace System.XML"

标签 c# xml service reference

我正在创建一个 PCL(可移植类库),它使用我用来使用某些服务的服务引用,但是当我尝试编译时出现以下错误:

"XmlElement does not exist in the namespace System.XML" in the reference.cs file

"schema could not be found" in the reference.cs file

我对此感到非常疯狂。 提前致谢

更新:

按照建议引用了 Windows.Data.Xml.Dom,并修改了 reference.cs(只是为了试一试)但我仍然收到架构错误,我不知道它来自哪个命名空间

已解决: 我正在使用一个无法序列化的对象(数据集),这是错误类模式的罪魁祸首

谢谢你的帮助

最佳答案

您的 PCL 可能针对 XmlElement 类不存在的 .NET 框架版本。

查看 msdn page ,它似乎没有提到 Silverlight、XNA、Windows Phone 或 WinRT...因此,如果您的目标是其中任何一个 - System.XML.XmlElement 根本不可用。

您必须寻找在您定位的所有平台上都可用的等效类型,或者使用第 3 方库。例如,有一个 Windows.Data.Xml.Dom.XmlElement适用于 Windows 8/Windows Phone 8.1

关于C# - 可移植类库 "XmlElement does not exist in the namespace System.XML",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23891939/

相关文章:

python - 针对架构的 XML (.xsd) 提要验证

java - 在Thread内创建一个service或者在Service内创建一个service

c# - 将 ContextMenu 绑定(bind)到 Datagrid 列

c# - 如何在 C# 中获取枚举的小写表示形式?

ruby-on-rails - 如何在 Rails 中将 XML 转换为散列?

java - 在 Java 中通过 XML 标签分割字符串

c# - LINQ Where 语法

c# - 如何在 System.Windows.Forms.WebBrowser 中判断加载的页面是错误页面还是有效页面?

java - 如何启动服务在android中重复做某事

javascript - 我使用的 Angular 工厂出现以下错误