Reputation:
I have been using HTMLAgilityPack from within Visual Studio without a single problem. I extracted HtmlAgilityPack to my HD, and added the file HtmlAgilityPack.dll as a reference to my C# application. Again everything is working splendid from within Visual Studio. I then built my solution and attempted to run my application outside of visual studio (as a standalone desktop executable file) and I get the following error when I run my application:
"Unhanded exception has occurred in your application. If you click Continue, the application will .... Could not load file or assembly 'HtmlAgilityPack, Version=1.4.0.0. Culture=neutral.PublicKeyToken=bd319b...' or one of its dependencies. The system cannot find the file specified."
How is is possible that the system can't find the file specified? Visual Studio had no trouble finding it...
I can provide any additional information upon request.
Thank you for any help with this one - Evan
Upvotes: 1
Views: 10879
Reputation: 2117
Build the solution not only the project. Select your solution and press ctrl + Shift + B
Upvotes: 0
Reputation:
I figured this one out. The problem was that I was using an EXPERIMENTAL copy of HtmlAgilityPack. I changed over to the 'full' version HERE and everything works great now!
Upvotes: 2
Reputation: 5828
The assembly HtmlAgilityPack.dll is needed for your program to run. At runtime, the CLR will look for it in several palaces. The most convenient ones are:
So either make sure HtmlAgilityPack.dll is in the same directory as you EXE, or put it into the GAC (using gacutil.exe).
Upvotes: 0