(不可能)在 Unity 中找不到 HtmlAgilityPack

(Impossible) HtmlAgilityPack not found in Unity

我的 HtmlAgilityPack 有问题...
我已经在 Visual Studio 中正确导入了包(参考 > 管理 NuGet 包 > 浏览,并且刚刚安装了包)
在 Unity 中我得到这个错误:

Assets/Scripts/Searcher.cs(13,7): error CS0246: The type or namespace name 'HtmlAgilityPack' could not be found. Are you missing an assembly reference?

我没有忘记在我的脚本中添加两个 using HtmlAgilityPack;

使用 ? :
- 统一 2017.2.1f1
- 微软 Visual Studio 社区 2015
- HtmlAgilityPack 1.6.13

基于 Unity Answers 上的类似问题:

Unity itself is incapable of handling Nuget packages, they're more of a VS thing. But as long as the assembly targets .NET 2.0 you should be able to use the .dll in Unity without issue

我找不到任何关于 HtmlAgilityPack 所针对的 .NET 版本的信息,但我的猜测是它与 Unity 使用的 不同。默认情况下,Unity 2017 使用 .NET 3.5 运行时,可以选择切换到实验性 4.6 运行时。

最好的兼容性是两者都针对相同的版本,但如果版本不同,Unity 将需要更新,就好像 dll 使用由 (比如说).NET 4.6 和 Unity 设置为使用 .NET 3.5,Unity 将无法处理这些调用。

尝试更改为 .NET 4.6 实验性运行时,看看是否可行。

在编辑 -> 项目 -> 播放器下:

不确定为什么将其标记为不可能。您只需将 HTMLAgilityPack.dll 放入 Unity 即可完成此操作。 Unity 将识别该库并使其在 VS2017 中可用。

Here's what it looks like in Unity when imported correctly.

我正在使用(实验性 .Net 4.6),但我怀疑这会有所作为。