private BindingRedirectAssemblyLoaderBackend(
     Dictionary <string, BindingRedirect> bindingRedirects,
     AssemblyDependencyTracker assemblyDependencyTracker)
 {
     _BindingRedirects          = bindingRedirects;
     _AssemblyDependencyTracker = assemblyDependencyTracker;
     AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve;
 }
        public static bool TryCreate(string assemblyFilePath, AssemblyDependencyTracker assemblyDependencyTracker, out IAssemblyLoaderBackend backend)
        {
            backend = null;

            string configFilePath = assemblyFilePath + ".config";

            if (!File.Exists(configFilePath))
            {
                return(false);
            }

            var bindingRedirects = _LoadBindingRedirects(configFilePath);

            if (bindingRedirects != null)
            {
                backend = new BindingRedirectAssemblyLoaderBackend(bindingRedirects, assemblyDependencyTracker);
            }

            return(true);
        }
 public HeuristicAssemblyLoaderBackend(AssemblyDependencyTracker assemblyDependencyTracker, params string[] probingPaths) :
     base(probingPaths)
 {
     _AssemblyDependencyTracker = assemblyDependencyTracker;
 }