FileNotFoundException when importing assembly from PluginFolder

Locked FileNotFoundException when importing assembly from PluginFolder

  • 11 เมษายน 2555 11:08
     
     

    Hi all,

    I am facing a little problem that I can not understand.

    My app has the following structure:

    [AppFolder]
         MainApplication.exe
         [lib]
              contracts.dll
         [plugins]
              [HelloWorldPlugin]
                   HelloWorld.exe

    The MainApplication creates DirectoryCatalogs for all subfolders in [plugins]
    The HelloWorld.exe refernces the contracts.dll in order to fulfill the contract
    The MainApplication.exe also references the contracts.dll for the importing routines

    When importing the HelloWorld.exe I always run into a FileNotFound exception regarding the contracts.dll file.

    I compiled the HelloWorld.exe using copylocal false and true (which copies the contracts.dll into the [HelloWprldPlugin] folder) neither did work.

    The only solution that I found so far was to implement an AssemblyResolve in the MainApplication.exe that loads the contracts.dll from the [lib] folder.

    I do not understand why this is happening, the contracts.dll is in the [HelloWorldPlugin] folder, shouldn't it be found then?

    Any help or enlightment is kindly appreciated :)

    best regards
    Andy


    If you build it, they will come....

ตอบทั้งหมด

  • 22 พฤษภาคม 2555 18:22
     
     

    Could you post some sample code? I couldn't reproduce the error.

    Thanks