如何在 .Net Core 1.0 中使用 XPathSelectElement? [英] How to use XPathSelectElement in .Net Core 1.0?
问题描述
在.Net 4.X
中,这个扩展方法在System.Xml.XPath
下.
In .Net 4.X
, this extension method is under System.Xml.XPath
.
但是我想知道如何在 .Net Core 中找到/使用它?我有一个班级图书馆.
However I'd like to know how could I find/use it in .Net Core? I have a class library.
移植工具没有显示任何关于 XPathSelectElement
的信息.
The porting tool doesn't show anything about XPathSelectElement
.
或者 .Net 核心中的任何替代品?
Or maybe any replacement in .Net core?
非常感谢!
推荐答案
您需要添加包System.Xml.XPath.XDocument 4.0.1
.此包提供了将 System.Xml.XPath
支持添加到 System.Xml.XDocument
包的扩展方法.
You need to add package System.Xml.XPath.XDocument 4.0.1
. This package provides extension methods that add System.Xml.XPath
support to the System.Xml.XDocument
package.
在包管理器控制台中运行以下命令.
Run below command in Package Manager Console.
PM> Install-Package System.Xml.XPath.XDocument -Version 4.0.1
您也可以从具有 NuGet 2.12
或更高版本的 NuGet 包管理器安装它.
You can also install it from NuGet package manager having version NuGet 2.12
or higher.
这篇关于如何在 .Net Core 1.0 中使用 XPathSelectElement?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!