private static FileInfoBase ChooseCsproj(FileInfoBase[] fileInfos) { if (fileInfos.Length > 1) { SystemContext.ConsoleWriteLine("Multiple csproj files found for namespace, using the first one."); } FileInfoBase fileToSearch = fileInfos[0]; return(fileToSearch); }
private static FileInfoBase[] FindAllCsprojFiles(DirectoryInfoBase directory) { FileInfoBase[] fileInfos = directory.GetFiles("*.csproj", SearchOption.TopDirectoryOnly); if (fileInfos.Length == 0) { SystemContext.ConsoleErrorWriteLine("No csproj file found for default namespace. Please specify a namespace as a command argument."); throw new FileNotFoundException(); } return(fileInfos); }