I am reading dlls and process types from a folder.
xxx.dll
xxx.interfaces.dll
When I load xxx.dll and call GetTypes on that assembly, it is throwing an exception...
{System.IO.FileNotFoundException: Could not load file or assembly 'xxx.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
File name: 'xxx.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'
=== Pre-bind state information ===
LOG: User = xxx
LOG: DisplayName = xxx.Interfaces, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
(Fully-specified)
LOG: Appbase = file:///<myapp>/bin/Debug/
LOG: Initial PrivatePath = NULL
Calling assembly : (Unknown).
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: <myapp>\bin\Debug\Diagrammer.vshost.exe.Config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: The same bind was seen before, and was failed with hr = 0x80070002.
}
It seems it is trying to fetch the dependent dll from the launching application path than the assembly being loaded. When I check loading and processing the assembly xxx.Interfaces.dll, it worked fine.