Quantcast
Channel: htmlagilitypack Forum Rss Feed
Viewing all articles
Browse latest Browse all 655

New Post: Add-Type htmlagilitypack.dll fails - help?

$
0
0
I used this code and it works at home (Windows 8.1) . Now I am at work (Windows 8.1 in domain) and I get the same error .

Now I am trying something smart to detect the CLRversion and to loadt the corresponding Assembly, but without success.
$CLRVersion = "Net"+ $PSVersionTable.CLRVersion.Major + $PSVersionTable.CLRVersion.Minor
$HtmlAgilityPack = Join-Path (Join-Path (Split-Path $MyInvocation.MyCommand.Path) $CLRVersion) HtmlAgilityPack.dll
Add-Type -Path $HtmlAgilityPack
HappyWindowsAdmin, try to use the following construct:
[system.reflection.assembly]::LoadFile('c:\Data\Development\ServiceStar\HtmlAgilityPack.dll')
You must use an absolute path here.

Solved!!!!!

The assembly I am trying is from an internet location. PowerShell does not like to load assemblies from the Internet. To solve , do this:
  • Open properties of the DDL file
  • On the General page, under Security, clock [Unblock]

Viewing all articles
Browse latest Browse all 655

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>