public AssemblyDefinition Resolve(AssemblyNameReference name, string basePath) { AssemblyDefinition asm = (AssemblyDefinition)_assemblies [name.FullName]; if (asm == null) { if (app != null) { string ares = app.ResolveAssembly(name.Name); if (ares != null) { asm = AssemblyFactory.GetAssembly(ares); asm.Resolver = this; _assemblies [name.FullName] = asm; return(asm); } } string file = Resolve(name.FullName, basePath); if (file != null) { asm = AssemblyFactory.GetAssembly(file); } else { asm = base.Resolve(name); } asm.Resolver = this; _assemblies [name.FullName] = asm; } return(asm); }
public AssemblyDefinition Resolve(AssemblyNameReference name, string basePath) { AssemblyDefinition asm = (AssemblyDefinition)_assemblies [name.FullName]; if (asm == null) { if (app != null) { string ares = app.ResolveAssembly(name.Name); if (ares != null) { asm = AssemblyDefinition.ReadAssembly(ares, new ReaderParameters { AssemblyResolver = this }); _assemblies [name.FullName] = asm; return(asm); } } string file = Resolve(name.FullName, basePath); if (file != null) { asm = AssemblyDefinition.ReadAssembly(file, new ReaderParameters { AssemblyResolver = this }); } else { asm = base.Resolve(name); } _assemblies [name.FullName] = asm; } return(asm); }
public string Resolve(string assemblyName, string basePath) { if (app != null) { string ares = app.ResolveAssembly(assemblyName); if (ares != null) { return(ares); } } StringCollection col = new StringCollection(); col.Add(basePath); foreach (string s in Directories) { col.Add(s); } try { return(Resolve(AssemblyNameReference.Parse(assemblyName), col)); } catch { } return(null); }