Skip to content Skip to sidebar Skip to footer

(Impossible) HtmlAgilityPack Not Found In 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

Solution 1:

Not sure why this was marked impossible. You can do this by simply dropping HTMLAgilityPack.dll into Unity. Unity will recognize the library and make it available in VS2017.

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

I am on (Experimental .Net 4.6), but I doubt that makes a difference.


Solution 2:

Based on a similar question over on 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

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.

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.

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

Under Edit -> Project -> Player:

Settings


Post a Comment for "(Impossible) HtmlAgilityPack Not Found In Unity"