I have the following problem: my exe (the static linker) reads an assembly
from a user-specified path. This works so far, but if the parsed assembly
has assembly dependencies (e.g. TestLib.dll in the same directory),
Mono.Cecil won't be able to resolve the references in the parsed exe to the
custom libaries.

Right now I'm working around this problem by copying any .dlls on which the
processed exe depends to the same directory as my StaticLinker.exe, but
that's not a very nice solution. I was wondering if it was possible to
implement a custom assembly resolver? I noticed that there is an interface
for that (IAssemblyResolver), and I also found the default assembly resolver
(GlobalAssemblyResolver), but that's a read-only (I mean,
GlobalAssemblyResolver.Instance), and I couldn't find any ways to pass a
custom IAssemblyResolver to Mono.Cecil. I think the best would be if we had
an overload of AssemblyDefinition's ReadAssembly() and ModuleDefinition's
ReadModule() taking an IAssemblyResolver.

Did I miss something? Is it possible to use a custom IAssemblyResolver?

Thank you!

-- 
--
mono-cecil

Reply via email to