我有以下情況:我有一個Windows服務,使用Microsoft AddIn框架將許多外部.dll加載爲AddIns。 AddIn .dlls分別位於位於包含service exe目錄的「AddIns」目錄中的各自目錄中。每個AddIn .dll引用一個常見的程序集,這個程序集基本上是AddIns的一個API。我把它放在服務目錄中。我遇到的問題是,API .dll文件必須在每一個外接程序目錄也還是我的錯誤:無法加載.NET程序集
Exception has been thrown by the target of an invocation. - System.IO.FileNotFoundException: Could not load file or assembly 'OSAE.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
我也試過這個組件添加到這似乎把它放在C:\Windows\Microsoft.NET\assembly\GAC_MSIL\OSAE.API\v4.0_1.0.0.0__f47a6446f36f79f7
GAC中,但這似乎沒有幫助。
我該如何告訴AddIns在程序集的特定目錄中查找,或將它設置在全局可訪問的位置?
謝謝。我能夠使用您的其他響應來弄清楚如何在自己的應用程序域中打開每個插件。 – Brian