ASP.NET => Compiler Error Message: CS0246: The type or namespace name 'HtmlAgilityPack'

.net asp.net c# html-agility-pack

Question

using HtmlAgilityPack;

// reference it

Produces error: ASP.NET => Compiler Error Message: CS0246: The type or namespace name 'HtmlAgilityPack' ...

HtmlAgilityPack IS referenced in my web site.

Switched from ASP.NET 2.0 to 4.0. After that, got this error. When making a console or windows forms application, all is fine, but ASP.NET build system gives me this error. I have this compile error when using HtmlAgilityPack.

No luck till today fixing this.

Popular Answer

Had the same problem, my .NET project was targeting .NET Framework 4.0 but HtmlAgilityPack.dll was build with .NET Framework 4.5.

The solution was to reference the HtmlAgilityPack.dll build with .NET Fx 4.0.

The download package for HtmlAgilityPack offers versions for Net20, Net40, Net45 and even WinRT.




Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Is this KB legal? Yes, learn why