2

I have some screen scraping I need to do using Powershell and ran across this article

http://www.leeholmes.com/blog/2010/03/05/html-agility-pack-rocks-your-screen-scraping-world/

And wanted to get a quick demo up and running. However, I'm running into a snag right away and not sure why it's failing.

The code is below:

add-type -Path "C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll"

Right away, I get the following error:

PS C:\TEMP\HtmlAgilityPack\Net20> add-type -Path "C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll"
Add-Type : Could not load file or assembly 'file:///C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
At line:1 char:9
+ add-type <<<<  -Path "C:\TEMP\HtmlAgilityPack\Net20\HtmlAgilityPack.dll"
    + CategoryInfo          : NotSpecified: (:) [Add-Type], BadImageFormatException
    + FullyQualifiedErrorId : System.BadImageFormatException,Microsoft.PowerShell.Commands.AddTypeCommand

1 Answer 1

2

your issue is that its defaulted to run against 2.0 runtime I belive this question tells you how to solve it.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.