private string ResolveBinariesDirectory() { var searchDirectories = new[] { // First search from the additional search directory, if provided _additionalSearchDirectory, // Then search from the project directory FolderSearch.CurrentExecutingDirectory(), // Finally search from the nuget cache directory _nugetCacheDirectory }; return(FindBinariesDirectory(searchDirectories.Where(x => !string.IsNullOrWhiteSpace(x)).ToList())); }
private string ResolveBinariesDirectory() { var binariesFolder = // First try path when installed via nuget FolderSearch.CurrentExecutingDirectory().FindFolderUpwards(Path.Combine(_nugetPrefix, _searchPattern)) ?? // second try path when started from solution FolderSearch.CurrentExecutingDirectory().FindFolderUpwards(_searchPattern); if (binariesFolder == null) { throw new MonogDbBinariesNotFoundException(string.Format( "Could not find Mongo binaries using the search pattern of \"{0}\". We walked up to root directory from {1} and {2}. You can override the search pattern when calling MongoDbRunner.Start. We have detected the OS as {3}", _searchPattern, FolderSearch.CurrentExecutingDirectory(), Path.Combine(_nugetPrefix, _searchPattern), RuntimeInformation.OSDescription)); } return(binariesFolder); }
private string ResolveBinariesDirectory() { var binariesFolder = // First try path when installed via nuget FolderSearch.CurrentExecutingDirectory().FindFolderUpwards(Path.Combine(_nugetPrefix, _searchPattern)) ?? // second try path when started from solution FolderSearch.CurrentExecutingDirectory().FindFolderUpwards(_searchPattern); if (binariesFolder == null) { throw new MonogDbBinariesNotFoundException(string.Format( "Could not find Mongo binaries using the search pattern of \"{0}\". We walked up the directories {1} levels from {2} and {3}. You can override the search pattern when calling MongoDbRunner.Start. We have detected the OS as {4}", _searchPattern, FolderSearch.MaxLevelOfRecursion, FolderSearch.CurrentExecutingDirectory(), Path.Combine(_nugetPrefix, _searchPattern), Environment.OSVersion.Platform)); } return(binariesFolder); }