我正在创建一个 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/