private async Task <ReportDefinitionFile> ResolveReportDefinitionAsync(string name) { if (0 != string.Compare(FileSystemReportRepository.Extension, Path.GetExtension(name), StringComparison.OrdinalIgnoreCase)) { name += FileSystemReportRepository.Extension; } IFileInfo reportFileInfo = null; IFileInfo environmentSpecificFileInfo = this.FileProvider.GetFileInfo(Path.Combine(this.HostingEnvironment.EnvironmentName, name)); if (!environmentSpecificFileInfo.Exists || environmentSpecificFileInfo.IsDirectory) { IFileInfo genericFileInfo = this.FileProvider.GetFileInfo(name); if (!genericFileInfo.Exists || genericFileInfo.IsDirectory) { throw new FileNotFoundException($"Report definition '{name}' could not be found."); } reportFileInfo = genericFileInfo; } else { reportFileInfo = environmentSpecificFileInfo; } if (null == reportFileInfo) { throw new FileNotFoundException($"Report definition '{name}' could not be found."); } string basePath = await this.ResolveBasePathAsync(reportFileInfo); return(new ReportDefinitionFile() { Name = reportFileInfo.Name, Path = reportFileInfo.GetDirectoryName(this.Options.RootPath), Base = basePath }); }