/// <summary> /// Raises an exception if the file couldn't be found /// </summary> /// <param name="basename"></param> /// <param name="customSearchDirectories"></param> /// <returns></returns> public static string FindExecutable(string basename, IEnumerable <string> customSearchDirectories = null) { var logger = new LoadLogger { verb = "located", filename = GetFilenameWithoutDirectory(basename) }; if (TryLoadByBasename(basename, logger, out var exePath, customSearchDirectories)) { return(exePath); } logger.RaiseException(); return(null); }