(不可能)在Unity中找不到HtmlAgilityPack [英] (Impossible) HtmlAgilityPack not found in Unity

查看:191
本文介绍了(不可能)在Unity中找不到HtmlAgilityPack的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I have a problem with the HtmlAgilityPack...
I have correctly imported the pack in Visual Studio (References > Manage NuGet Packages > Browse, and just installed the package)
In Unity I get this error:

资产/脚本/Searcher.cs(13,7):错误CS0246:找不到类型或名称空间名称'HtmlAgilityPack'.您是否缺少装配参考?

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;

I didn't forgot two add using HtmlAgilityPack; in my script

使用? :
-Unity 2017.2.1f1
-Microsoft Visual Studio社区2015
-HtmlAgilityPack 1.6.13

Using ? :
- Unity 2017.2.1f1
- Microsoft Visual Studio Community 2015
- HtmlAgilityPack 1.6.13

推荐答案

基于

Unity本身无法处理Nuget包,它们更像是VS.但是只要程序集的目标是.NET 2.0,您就应该能够在Unity中使用.dll而不会出现问题

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 2017使用.NET 3.5运行时,并带有一个选项以切换到实验性4.6运行时.

I can't find any information on what version of .NET that HtmlAgilityPack targets, but my guess is that it isn't the same as what Unity uses. By default Unity 2017 uses the .NET 3.5 runtime with an option to switch to the experimental 4.6 runtime.

最好的兼容性是两个目标都使用相同的版本,但是在不同的情况下,Unity将需要为 new ,就像dll使用(例如).NET 4.6添加的功能一样.并且将Unity设置为使用.NET 3.5,则Unity将无法处理这些调用.

The best compatibility will be with both targetting the same version, but in the case of it differing, Unity will need to be newer as if the dll uses features added by (say) .NET 4.6 and Unity's set to use .NET 3.5, Unity won't be able to handle those calls.

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

Try changing to the .NET 4.6 experimental runtime and seeing if that works.

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

Under Edit -> Project -> Player:

这篇关于(不可能)在Unity中找不到HtmlAgilityPack的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆