private static IEnumerable <string> GetReferencePaths(CompilationLibrary x) { try { return(x.ResolveReferencePaths()); } catch { return(new List <string>()); } }
private IEnumerable <string> ResolveReferencePaths(CompilationLibrary compilationLibrary, ICompilationAssemblyResolver[] compilationAssemblyResolvers) { if (compilationLibrary.Assemblies.Any(a => a.EndsWith("_._"))) { return(Array.Empty <string>()); } var referencePaths = compilationLibrary.ResolveReferencePaths(compilationAssemblyResolvers).ToArray(); foreach (var referencePath in referencePaths) { _logger.Debug($"{compilationLibrary.Name} => {referencePath}"); } return(referencePaths); }
private static IEnumerable <string> ResolvePaths(CompilationLibrary library) { var assemblies = AppDomain.CurrentDomain.GetAssemblies(); for (var i = 0; i < assemblies.Length; i++) { if (assemblies[i].GetName().Name == library.Name) { return(new[] { assemblies[i].Location }); } } try { return(library.ResolveReferencePaths()); } catch (InvalidOperationException) { } return(Array.Empty <string>()); }