/// <summary>
        /// Creates a <see cref="PathAssemblyResolver"/> from the specified path.
        /// </summary>
        /// <param name="path">The path.</param>
        /// <returns>PathAssemblyResolver.</returns>
        /// <exception cref="DirectoryNotFoundException"></exception>
        public static PathAssemblyResolver Create(string path)
        {
            if (!Directory.Exists(path))
            {
                throw new DirectoryNotFoundException(path);
            }

            IEnumerable <string> assemblyPaths = Directory.EnumerateFiles(path, "*.dll", SearchOption.TopDirectoryOnly);

            return(new PathAssemblyResolver(StaticAssemblyResolver.Create(assemblyPaths)));
        }
        /// <summary>
        /// Creates a <see cref="AssemblyResolutionManager"/> from the specified assembly lookup paths and options.
        /// </summary>
        /// <param name="assemblyLookupPaths">The assembly lookup paths.</param>
        /// <param name="transformerOptions">The transformer options.</param>
        /// <returns>A <see cref="AssemblyResolutionManager"/>.</returns>
        public static AssemblyResolutionManager Create(IEnumerable <string> assemblyLookupPaths, SymbioticTransformerOptions transformerOptions)
        {
            AssemblyResolutionManager assemblyResolver = AssemblyResolutionManager.CreateDefault();

            if (!string.IsNullOrEmpty(transformerOptions.AssemblyReferencesFilePath))
            {
                string[] assemblyPaths = File.ReadAllLines(transformerOptions.AssemblyReferencesFilePath);
                assemblyResolver.AddAssemblyResolver(StaticAssemblyResolver.Create(assemblyPaths));
            }

            foreach (string lookupPath in assemblyLookupPaths)
            {
                assemblyResolver.AddAssemblyResolver(PathAssemblyResolver.Create(Path.GetDirectoryName(lookupPath)));
            }

            return(assemblyResolver);
        }
 /// <summary>
 /// Initializes a new instance of the <see cref="PathAssemblyResolver" /> class.
 /// </summary>
 /// <param name="assemblyResolver">The assembly resolver.</param>
 /// <exception cref="ArgumentNullException">assemblyResolver</exception>
 private PathAssemblyResolver(StaticAssemblyResolver assemblyResolver)
 {
     this.assemblyResolver = assemblyResolver ?? throw new ArgumentNullException(nameof(assemblyResolver));
 }