gpt4 book ai didi

c# - 在可移植类库中包含 XPathSelectElement

转载 作者:数据小太阳 更新时间:2023-10-29 02:40:54 26 4
gpt4 key购买 nike

如何在可移植类库中使用 XPathSelectElement?当我尝试在项目中包含 System.Xml.XPath 程序集时,出现以下错误:

The type 'System.Xml.Linq.XElement' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Xml.Linq, Version=2.0.5.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

我的可移植类库已经引用了 System.Xml.Linq

最佳答案

不幸的是,MSDN表明,从 .NET 4.5 开始,可移植类库不支持这些扩展方法。如果支持它们,它们将显示 PCL icon图片。但是,看起来 Microsoft 确实提供了 a Nuget package它至少提供了 System.Xml.XPath 命名空间中的一些功能。

关于c# - 在可移植类库中包含 XPathSelectElement,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20651431/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com