如何在.Net Core 1.0中使用XPathSelectElement?

Sam*_*uel 7 c# xpath nuget .net-core asp.net-core

.Net 4.X,这个扩展方法是在System.Xml.XPath.

但是,我想知道如何在.Net Core中找到/使用它?我有一个类库.

移植工具没有显示任何内容XPathSelectElement.

或者.Net核心中的任何替代品?

非常感谢!

Rah*_*ate 7

你需要添加包System.Xml.XPath.XDocument 4.0.1.此包提供了添加System.Xml.XPathSystem.Xml.XDocument包的支持的扩展方法.

在Package Manager Console中运行以下命令.

PM> Install-Package System.Xml.XPath.XDocument -Version 4.0.1
Run Code Online (Sandbox Code Playgroud)

您也可以从具有NuGet 2.12更高版本或更高版本的NuGet包管理器安装它.


Sam*_*uel 0

根据Lex Li的建议,我们可以使用这个网站来搜索包名称。就我而言,它是:System.Xml.XPath.XDocument