简体   繁体   中英

C# - Portable Class Library “XmlElement does not exist in the namespace System.XML”

I'm creating a PCL (Portable Class Library) that uses a service reference that I use to consume some services, but when I try to compile I get this errors:

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

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

I'm getting completely crazy about this. Thanks in advance

UPDATE:

Referenced Windows.Data.Xml.Dom as suggested, and modified the reference.cs (just to give it a try) but im still getting the schema error and I have no idea from which namespace it is

SOLVED: I was using an object that could not be serialized (dataset) that was the blame for the bad class schema

Thanks for your help anyways

XMLElement found in Windows.Data.Xml.Dom namespace

Add the reference

Your PCL probably targets versions of the .NET framework where the XmlElement class does not exist.

Looking at the msdn page , it doesn't seem to mention Silverlight, XNA, Windows Phone, or WinRT... so if you're targeting any of these - System.XML.XmlElement simply isn't available.

You'll have to look for an equivalent type that is available on all the platforms you're targeting, or use a 3rd party library. For example, there is a Windows.Data.Xml.Dom.XmlElement available on Windows 8 / Windows Phone 8.1

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM