/// <summary> /// Help .NET resolving missing assemblies (because we distribute assemblies in different directories, e.g. for each MEF module). /// Include search in same folders where MEF already loads some parts. /// This method will search recursively in all subdirectories as well. /// </summary> /// <remarks> /// This helps to find .resource assemblies (localization resources) for example. /// </remarks> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="System.ResolveEventArgs"/> instance containing the event data.</param> /// <returns></returns> private Assembly TryResolveMissingAssembly(object sender, ResolveEventArgs args) { var filename = args.Name.Split(',')[0] + ".dll"; var directories = _recursiveDirectoryCatalog.LoadedAssemblies.Select(Path.GetDirectoryName) .Where(x => x != null) .Distinct(); return(BootstrapperUtil.TryLoadAssembly(filename, directories)); }
private string GetRootPath(string searchFromPath) { return(BootstrapperUtil.FindRoot(searchFromPath, _bootrapperConfiguration.RootFolderName)); }