Well, the loaded assembly doesn't have an application configuration file.
I cannot use a config file because the assemblies to be loaded are determined at runtime. :(
Edit:
I'll try to restate. (Thanks for the help so far!)
The application dynamically loads assemblies from well-known sub-directories. These assemblies have static references to other assemblies. I want to deploy those dependencies with its dependent assembly together into one directory - a sub directory of the main application.
The goal is to have a folder structure like this:
- Modules
- Module1
- Module1.dll
- 3rdParty.dll
- Theme1.dll
- Module2
- Module2.dll
- OtherComp.dll
- Theme2.dll
- Shell.exe
So Shell.exe knows loads "Module1.dll" and "Module2.dll" with LoadFrom() dynamically. "3rdParty.dll" and "Theme1.dll" are dependencies of "Module1.dll" and linked statically. But the runtime is looking for them in the application's base directory instead of the Module1's sub directory.