public Assembly Load(string path) { var(asmName, asm) = _loader.Load(path); if (!_assemblies.ContainsKey(asmName.Name)) { _assemblies.TryAdd(asmName.Name, asm); } return(asm); }
static Assembly CurrentDomain_AssemblyResolve(object sender, ResolveEventArgs args) { var assemblyname = new AssemblyName(args.Name).Name; Console.WriteLine(assemblyname); DynamicLoad load = new DynamicLoad(); var assembly = load.Load($"plugin1/{assemblyname}.dll"); /* var assemblyname = new AssemblyName(args.Name).Name; * var assemblyFileName = Path.Combine("plugins", "plugin1", assemblyname + ".dll"); * var assembly = Assembly.LoadFrom(assemblyFileName); */ return(assembly.Item2); }