Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/275.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在Windows应用商店应用程序中,类型为';XmlNode';和';XmlElement';不存在_C#_Windows 8.1 - Fatal编程技术网

C# 在Windows应用商店应用程序中,类型为';XmlNode';和';XmlElement';不存在

C# 在Windows应用商店应用程序中,类型为';XmlNode';和';XmlElement';不存在,c#,windows-8.1,C#,Windows 8.1,在开发Windows应用商店应用程序时,我知道类型“System.Xml.XmlNode”和“System.Xml.xmlement”不存在。 下面的代码给出了一个错误 public static XmlElement GetElement(XmlElement parent, string elementName, string namespaceURI) { foreach (XmlNode x in parent.ChildNodes)

在开发Windows应用商店应用程序时,我知道类型“System.Xml.XmlNode”和“System.Xml.xmlement”不存在。 下面的代码给出了一个错误

public static XmlElement GetElement(XmlElement parent, string elementName, string namespaceURI)
        {
            foreach (XmlNode x in parent.ChildNodes)
            {
                if (x.NodeType == XmlNodeType.Element && x.Name.Equals(elementName) && x.NamespaceURI.Equals(namespaceURI))
                    return (XmlElement)x;
            }

            return null;
        }
错误

中不存在类型或命名空间名称“XmlElement” 命名空间“System.Xml”(是否缺少程序集引用?)

请告诉我.NetCore中是否有这些类的替换。我将转换为使用


它不是DOM API的完美替代品,但在许多平台上都支持它。

使用linq to xml怎么样?@SonerGönül这些类在此API中不可用。@soner:当dll自动添加到win-win store应用程序中时,是否需要添加dll?我只是在使用System.Xml@user3524034我建议使用linq to xml。@DanielA.White:可能的解决方案是什么?因为我必须将.net framework 4.5的所有代码转换为Windows.Data.Xml.Dom命名空间中的.netore.XMLElement。