HtmlAgilityPack - File not found

I am developing C # ASP.NET WebPart in SharePoint Foundation.

Everything works fine, now I want to parse an HTML page to get all ImagePaths and save images to HD / Temp.

To do this, I downloaded HtmlAgilityPack, the current version, added a link to Project, everything looks fine, IntelliSense works fine.

But when I want to run the section where HtmlAgilityPack should be used, my browser shows me

FileNotFoundException - File or assembly not found.

After the first requests, I tried to enable v1.4.0 from HtmlAgilityPack, because I read that the current version is not very stable in some cases. This works fine as long as I don't want to use HtmlAgilityPack, the same Exception.

I also tried moving the HtmlAgilityPack directly to the Solution directory, nothing has changed.

I tried to insert the HtmlAgilityPack through using , and I tried a direct call, for example. HtmlAgilityPack.HtmlDocument .

Output:

  • When I compile the error, the link is set correctly.

  • When I trace HtmlAgilityPack.dll with ProcMon, the path displays correctly, but sometimes the result is " File Locked with only Readers ", but I don’t know enough about ProcMon to know what this means, or if it matters, It could have nothing to do with File Permissions, because if I check the DLL, all permissions will be granted.

+4
source share
1 answer

I used the flexibility of HTML with this combination and it worked perfectly for me. Please try checking below and confirm.

  • The version of the loaded DLL should support your solution.
  • Be sure to place the copy in the GAC.
0
source

Source: https://habr.com/ru/post/1434869/


All Articles