public bool TryGetEntryProjectPaths()

in src/Microsoft.VisualStudio.SlnGen/ProgramArguments.cs [365:416]


        public bool TryGetEntryProjectPaths(ISlnGenLogger logger, out IReadOnlyList<string> projectEntryPaths)
        {
            List<string> result = new List<string>();

            projectEntryPaths = result;

            void SearchInDirectory(string directory)
            {
                logger.LogMessageNormal("Searching \"{0}\" for projects", directory);

                foreach (string projectPath in Directory.EnumerateFiles(directory, "*.*proj"))
                {
                    result.Add(projectPath);

                    logger.LogMessageNormal("Generating solution for project \"{0}\"", projectPath);
                }
            }

            if (Projects == null || !Projects.Any())
            {
                SearchInDirectory(Environment.CurrentDirectory);

                if (result.Count == 0)
                {
                    logger.LogError("No projects found in the current directory. Please specify the path to the project you want to generate a solution for.");
                }
            }
            else
            {
                foreach (string projectPath in ExpandWildcards(Projects).Select(Path.GetFullPath))
                {
                    if (File.Exists(projectPath))
                    {
                        logger.LogMessageNormal("Generating solution for project \"{0}\"", projectPath);

                        result.Add(projectPath);
                    }
                    else if (Directory.Exists(projectPath))
                    {
                        SearchInDirectory(projectPath);
                    }
                    else
                    {
                        logger.LogError($"Project file \"{projectPath}\" does not exist");

                        continue;
                    }
                }
            }

            return result.Count > 0;
        }