通用Windows平台中的System.Xml.XPath [英] System.Xml.XPath in Universal Windows Platform

查看:46
本文介绍了通用Windows平台中的System.Xml.XPath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据MSDN,System.Xml.XPath中的Extensions类应可用于通用Windows平台(Windows 10):

According to MSDN, Extensions class in System.Xml.XPath should be available for Universal Windows Platform (Windows 10):

https://msdn.microsoft.com/zh-CN/library/system.xml.xpath.extensions(v=vs.110).aspx

但是,在默认配置中,甚至System.Xml.XPath命名空间都不可用.编译器和IntelliSense找不到它,甚至Resharper也找不到丢失的参考-尽管根据MSDN,它应该在System.Xml.Linq.dll中.(我可以毫无问题地使用LINQ)

However in default configuration not even the System.Xml.XPath namespace is available. The compiler and IntelliSense doesn't find it and even Resharper is unable to find the missing reference - although according to MSDN it should be in System.Xml.Linq.dll. (I can use LINQ without any problem)

在参考管理器中,我也找不到装配.

Also in the reference manager I was unable to find a fitting assembly.

通过一些研究,我在NuGet上找到了这个官方的System.Xml.XPath软件包: https://www.nuget.org/packages/System.Xml.XPath/

With some research I've found this official System.Xml.XPath package on NuGet: https://www.nuget.org/packages/System.Xml.XPath/

但是,它也不包含Extension类(因此也不包含XPathSelectElement扩展方法).(但至少是其他XPath类)

However this does not contain the Extension class (and thus the XPathSelectElement extension method) either. (But at least the other XPath classes)

我做错什么了吗?或者这是文档中的错误,并且这些类都不适用于Windows 10?

Am I doing something wrong or this is an error in the documentation and none of these classes are available for Windows 10?

我已经做过的事情:

  • Visual Studio重新启动
  • Windows重新启动
  • 在另一台计算机上进行测试

推荐答案

因此,事实证明,您必须将 System.Xml.XPath.XDocument 程序包与Nuget添加在一起.不幸的是,在MSDN上没有对此进行记录.

So, it turned out that you have to add the System.Xml.XPath.XDocument Package with Nuget. It is a bit unfortunate that this is so undocumented on MSDN.

在MSDN Social上获得信贷: https://social.msdn.microsoft.com/Forums/windowsapps/zh-CN/46cc17ce-b562-4089-be9c-dd5aa53b36de/systemxmlxpath-in-universal-windows-platform?forum=wpdevelop

Credit goes to winffee on MSDN Social: https://social.msdn.microsoft.com/Forums/windowsapps/en-US/46cc17ce-b562-4089-be9c-dd5aa53b36de/systemxmlxpath-in-universal-windows-platform?forum=wpdevelop

这篇关于通用Windows平台中的System.Xml.XPath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆