{"id":575,"date":"2017-11-05T10:40:19","date_gmt":"2017-11-05T10:40:19","guid":{"rendered":"http:\/\/www.netexl.com\/blog\/?p=575"},"modified":"2026-04-02T10:13:10","modified_gmt":"2026-04-02T10:13:10","slug":"cannot-find-type-verify-that-the-assembly-containing-this-type-is-loaded-exception-from-hresult-0x80131515","status":"publish","type":"post","link":"https:\/\/www.netexl.com\/blog\/cannot-find-type-verify-that-the-assembly-containing-this-type-is-loaded-exception-from-hresult-0x80131515\/","title":{"rendered":"Cannot find type: verify that the assembly containing this type is loaded.  (Exception from HRESULT: 0x80131515)"},"content":{"rendered":"<p>Downloaded\u00a0\u00a0HtmlAgilityPack.dll and loaded in Windows Powershell by running the following command<\/p>\n<pre class=\"lang:default decode:true\">Add-Type -Path 'c:\\Temp\\PS\\Net40\\HtmlAgilityPack.dll'<\/pre>\n<p>Got the following error..<\/p>\n<blockquote><p>Add-Type : Could not load file or assembly &#8216;file:\/\/\/C:\\Temp\\PS\\Net40\\HtmlAgilityPack.dll&#8217; or one of its dependencies.<br \/>\nOperation is not supported. (Exception from HRESULT: 0x80131515)<br \/>\nAt C:\\Temp\\PS\\script.ps1:12 char:1<br \/>\n+ Add-Type -Path &#8216;c:\\Temp\\PS\\Net40\\HtmlAgilityPack.dll&#8217;<br \/>\n+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>\n+ CategoryInfo : NotSpecified: (:) [Add-Type], FileLoadException<br \/>\n+ FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand<\/p><\/blockquote>\n<p>&nbsp;<\/p>\n<p>HtmlAgilityPack.dll does not have any dependency for the .Net version I was on (use the command $psversiontable to get the .Net version used by Powershell)<\/p>\n<p>It turned out that the file was blocked since it was downloaded from the internet. All I needed to do was to go to\u00a0DLL&#8217;s properties and unblock it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-576 size-full\" src=\"https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2017\/11\/PS1.png\" alt=\"Exception from HRESULT: 0x80131515\" width=\"381\" height=\"519\" srcset=\"https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2017\/11\/PS1.png 381w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2017\/11\/PS1-220x300.png 220w, https:\/\/www.netexl.com\/blog\/wp-content\/uploads\/2017\/11\/PS1-206x280.png 206w\" sizes=\"auto, (max-width: 381px) 100vw, 381px\" \/><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Downloaded\u00a0\u00a0HtmlAgilityPack.dll and loaded in Windows Powershell by running the following command Add-Type -Path &#8216;c:\\Temp\\PS\\Net40\\HtmlAgilityPack.dll&#8217; Got the following error.. Add-Type : Could not load file or assembly &#8216;file:\/\/\/C:\\Temp\\PS\\Net40\\HtmlAgilityPack.dll&#8217; or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515) At C:\\Temp\\PS\\script.ps1:12 char:1 + Add-Type -Path &#8216;c:\\Temp\\PS\\Net40\\HtmlAgilityPack.dll&#8217; + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [Add-Type], FileLoadException + FullyQualifiedErrorId : System.IO.FileLoadException,Microsoft.PowerShell.Commands.AddTypeCommand &nbsp; HtmlAgilityPack.dll does not have any dependency for the .Net version I was on (use the command $psversiontable to get the .Net version used by Powershell) It turned out that the file was blocked since it was downloaded from the internet. All I needed to do was to go to\u00a0DLL&#8217;s properties and unblock it.<\/p>\n","protected":false},"author":5,"featured_media":1540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14],"tags":[],"class_list":["post-575","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-how-to"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/575","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/comments?post=575"}],"version-history":[{"count":2,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/575\/revisions"}],"predecessor-version":[{"id":578,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/posts\/575\/revisions\/578"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media\/1540"}],"wp:attachment":[{"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/media?parent=575"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/categories?post=575"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netexl.com\/blog\/wp-json\/wp\/v2\/tags?post=575"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}