简体   繁体   English

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

[英]How to use XPathSelectElement in .Net Core 1.0?

In .Net 4.X , this extension method is under System.Xml.XPath . .Net 4.X ,此扩展方法位于System.Xml.XPath下。

However I'd like to know how could I find/use it in .Net Core? 但是我想知道如何在.Net Core中找到/使用它? I have a class library. 我有一个班级图书馆。

The porting tool doesn't show anything about XPathSelectElement . 移植工具未显示任何有关XPathSelectElement

Or maybe any replacement in .Net core? 或.Net核心中的任何替代产品?

Thanks a lot! 非常感谢!

You need to add package System.Xml.XPath.XDocument 4.0.1 . 您需要添加软件包System.Xml.XPath.XDocument 4.0.1 This package provides extension methods that add System.Xml.XPath support to the System.Xml.XDocument package. 该软件包提供了扩展方法,这些扩展方法将System.Xml.XPath支持添加到System.Xml.XDocument软件包中。

Run below command in Package Manager Console. 在程序包管理器控制台中,运行以下命令。

PM> Install-Package System.Xml.XPath.XDocument -Version 4.0.1

You can also install it from NuGet package manager having version NuGet 2.12 or higher. 您也可以从具有NuGet 2.12或更高版本的NuGet 2.12软件包管理器中安装它。

As suggested by Lex Li, we could use this website to search the package name. 根据Lex Li的建议,我们可以使用该网站搜索软件包名称。 In my case it is: System.Xml.XPath.XDocument . 在我的情况下是: System.Xml.XPath.XDocument

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM