Benchmarque.Console.Program.GetDependentAssemblies C# (CSharp) Method

GetDependentAssemblies() static private method

static private GetDependentAssemblies ( string assemblyPath ) : IEnumerable
assemblyPath string
return IEnumerable
        static IEnumerable<string> GetDependentAssemblies(string assemblyPath)
        {
            Assembly assembly = Assembly.ReflectionOnlyLoadFrom(assemblyPath);

            var graph = new DependencyGraph<string>();

            foreach (AssemblyName referencedAssembly in assembly.GetReferencedAssemblies())
            {
                string referencedName = Path.GetFileName(referencedAssembly.Name);

                AddDependentAssembly(graph, assemblyPath, referencedName);
            }

            string assemblyFileName = Path.GetFileName(assemblyPath);

            return graph.GetItemsInDependencyOrder(assemblyFileName)
                .Where(x => x != Path.GetFileName(assemblyPath))
                .Where(x => x != "Benchmarque.dll");
        }