Invoke and assembly references/folders

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I have two assemblys A and B in folder 1. Assembly A references
assembly B.
In another folder 2, I have a program C that do a
Assmebly.LoadFile(<absolute path to assembly A) and creates an instance
of a class in A. When invoking a method (from the program C) in
assembly A that creates an instance of a class in assembly B I get a
TargetInvocationException with an inner FileNotFoundException.

The system is looking for assembly B in program Cs folder instead of
assembly As folder.
If I copy assembly B to program Cs folder it woks.

How do I make it search for the assembly in the "correct" folder?

Regards
Hans Forssell

.