HtmlAgilityPack - Vs 2010 - c# ASP - File Not found

Posted by Janosch Geigowskoskilu on Stack Overflow See other posts from Stack Overflow or by Janosch Geigowskoskilu
Published on 2012-09-18T15:01:44Z Indexed on 2012/09/18 15:37 UTC
Read the original article Hit count: 335

First, I've already searched the web & StackOverflow for hours, and i did find a lot about troubleshooting HtmlAgilityPack and tried most of these but nothing worked.

The Situation:

I'm developing a C# ASP .NET WebPart in SharePoint Foundation.

Everything works fine, now I want to Parse a HTML Page to get all ImagePaths and save the Images on HD/Temp.

To do that I was downloading HtmlAgilityPack, current version, add reference to Project, everything looks OK, IntelliSense works fine.

The Exception:

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

FileNotFoundException - The File or Assembly could not be found.

What I tried:

After first searches i tried to include v1.4.0 of HtmlAgilityPack cause I read that the current version in some case is not really stable. This works fine to until the point I want to use HtmlAgilityPack, the same Exception.

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

I tried to insert HtmlAgilityPack via using and I tried direct call e.g. HtmlAgilityPack.HtmlDocument.

Conclusion :

When I compile no error occurs, the reference is set correct. When I trace the HtmlAgilityPack.dll with ProcMon the Path is shown correct, 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 this is critical. It couldn't have something to do with File Permissions because if I check the DLL the permissions are all given.

© Stack Overflow or respective owner

Related posts about c#

Related posts about .NET