I have loaded assembly A in ReflectionOnly context in order to get information on types and their methods. At least one of methods has return type that is part of dependency assembly B.
The problem is that assembly B is not available and cannot be resolved so following FileNotFoundException is thrown:
Could not load file or assembly ‘B’ or one of its dependencies.
The system cannot find the file specified.
That exception is kind of expected. However, I have seen that Reflector CAN load type name (which is what I need) even when it cannot resolve dependency assembly.
Does someone know how to get name of type contained within missing assembly without getting FileNotFoundException?
EDIT:
Exception is thrown when trying to access ReturnType property:
Type returnType = methodInfo.ReturnType;
You can try to use a different library to load this assembly, like
Mono.Cecil.