{"id":4097,"date":"2014-03-30T07:41:32","date_gmt":"2014-03-30T07:41:32","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/unable-to-load-net-assembly-collection-of-common-programming-errors\/"},"modified":"2014-03-30T07:41:32","modified_gmt":"2014-03-30T07:41:32","slug":"unable-to-load-net-assembly-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/30\/unable-to-load-net-assembly-collection-of-common-programming-errors\/","title":{"rendered":"Unable to load .NET assembly-Collection of common programming errors"},"content":{"rendered":"<p>I have the following situation: I have a windows service that loads many external .dlls as AddIns using the Microsoft AddIn Framework. The AddIn .dlls are each in their own directory inside a &#8216;AddIns&#8217; directory that is located in the directory containing the service exe. Every AddIn .dll references a common assembly that is basically an API for the AddIns. I put this in the service directory. The problem I am having is that the API .dll must be in every AddIn directory also or I get the error:<\/p>\n<blockquote>\n<p>Exception has been thrown by the target of an invocation. &#8211; System.IO.FileNotFoundException: Could not load file or assembly &#8216;OSAE.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null&#8217; or one of its dependencies. The system cannot find the file specified.<\/p>\n<\/blockquote>\n<p>I have also tried add this assembly to the GAC which seems to put it at <code>C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL\\OSAE.API\\v4.0_1.0.0.0__f47a6446f36f79f7<\/code>, but this doesn&#8217;t seem to help.<\/p>\n<p>How can I either tell the AddIns to look in a specific directory for the assembly or set it up where it is globally accessible somehow?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I have the following situation: I have a windows service that loads many external .dlls as AddIns using the Microsoft AddIn Framework. The AddIn .dlls are each in their own directory inside a &#8216;AddIns&#8217; directory that is located in the directory containing the service exe. Every AddIn .dll references a common assembly that is basically [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4097","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4097","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=4097"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/4097\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=4097"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=4097"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=4097"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}