I\'m writing a utility for myself, partly as an exercise in learning C# Reflection and partly because I actually want the resulting tool for my own use.
What I\'m after
Couple of options here:
AppDomain.AssemblyResolve
and do another LoadFile
based on the requested assembly.AppDomain
with the directory as its base and load the assemblies in that AppDomain
.I'd highly recommend pursuing option 2, since that will likely be cleaner and allow you to unload all those assemblies after. Also, consider loading assemblies in the reflection-only context if you only need to reflect over them (see Assembly.ReflectionOnlyLoad
).