I have a Visual Studio 2010 project that targets .NET v3.5 (it's a Sharepoint site). I need to use the Html Agility Pack in my project, but obviously I can't use the .NET v4.0 version.
I downloaded the Html Agility Pack from codeplex, and added a reference to the DLL in the
Net20/ (.NET v2.0) directory to my Visual Studio project. However, when I go and check the reference properties, it says the "Runtime Version" is "v4.0.30319" rather than "v2.0.xxxxx", and thus my project won't compile.
"OK..." I said, and tried the more official way, with NuGet using the Package Manager in Visual Studio. I install Html Agility Pack, but again it doesn't compile because the runtime version is for .NET v4.0...
Can I somehow set the version I want to install in NuGet, or does it do this automatically? Am I just getting screwed by some mistake of the HAP devs not providing the correct DLL for .NET v2.0?
This is very frustrating, as I literally just need to compile this code I know works in .NET v4.0 and this project will be done. Any help is greatly appreciated.
What ended up working for me was the version here. I downloaded the "binaries", added the DLL, and the runtime version was .NET 2.0 as needed. My program works just as it did under .NET 4.0.
Try this one - it should be .Net 2.0 - http://htmlagilitypack.codeplex.com/releases/view/272