如何在.Net Core 1.0中使用XPathSelectElement?
在.Net 4.X
,此扩展方法位于System.Xml.XPath
下。
但是,我想知道如何在.Net Core中找到/使用它? 我有一个类库。
移植工具不显示有关XPathSelectElement
任何信息。
或者.Net核心中的任何替代品?
非常感谢!
您需要添加包System.Xml.XPath.XDocument 4.0.1
。 此包提供了将System.Xml.XPath
支持添加到System.Xml.XDocument
包的扩展方法。
在Package Manager Console中运行以下命令。
PM> Install-Package System.Xml.XPath.XDocument -Version 4.0.1
您也可以从NuGet 2.12
或更高版本的NuGet 2.12
包管理器安装它。
根据Lex Li的建议,我们可以使用此网站搜索包裹名称。 在我的例子中是: System.Xml.XPath.XDocument
。