Is there a way to resolve the dependencies of a target project, with the help of Mono.Cecil? #791
-
Hey there, I have managed to embedd some code before and after a method body. Using some classes like Stopwatch to catch the time needed in the method involves that the target program where I emebedded my code, needs to resolve the dll X for example, where the Stopwatch is in. Is it possible with Mono.Cecil, to tell the target program where he have to look for the dll X, to resolve it? Because I build a Profiler and it is not given, that I have always have the whole project, sometimes it could be only a executable. Or does anybody know how to do that? Because I have a program, which can't find/resolve the dll's I have used. Thanks for any help! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, I'm afraid there's nothing built-in to help resolving assemblies at runtime. I supposed you could inject IL to add an event handler for the |
Beta Was this translation helpful? Give feedback.
-
I would also strongly suggest looking at using the profiling API if you're making a profiler, instead of injecting code (which may or may interact badly with the JIT, which then invalidates the profiling results). |
Beta Was this translation helpful? Give feedback.
Hi,
I'm afraid there's nothing built-in to help resolving assemblies at runtime.
I supposed you could inject IL to add an event handler for the
AppDomain.AssemblyResolve
event to add custom resolving logic.