示例#1
0
        public VisualStudioSolution ReadSolution(string solutionPath, string configuration)
        {
            VisualStudioSolutionFileDetails solutionDetails = SolutionLoader.LoadVisualStudioSolution(solutionPath);

            var projects = new List <VisualStudioProject>();
            var sln      = new VisualStudioSolution(solutionPath)
            {
                VisualStudioProjects = projects
            };

            foreach (var project in solutionDetails.VisualStudioProjects)
            {
                if (Path.GetExtension(project.Path) == ".csproj")
                {
                    string projectFileName             = Path.Combine(Path.GetDirectoryName(solutionPath), project.Path);
                    VisualStudioProject projectDetails = ProjectLoader.LoadProject(projectFileName,
                                                                                   project.Name,
                                                                                   configuration);

                    projectDetails.Solution = sln;
                    projects.Add(projectDetails);
                }
            }

            return(sln);
        }
        public VisualStudioSolution ReadSolution(string solutionPath, string configuration)
        {
            VisualStudioSolutionFileDetails solutionDetails = SolutionLoader.LoadVisualStudioSolution(solutionPath);

            var csProjectReferences = solutionDetails.VisualStudioProjects.Where(r => Path.GetExtension(r.Path) == ".csproj");
            var sln = new VisualStudioSolution(solutionPath, configuration, csProjectReferences);

            return(sln);
        }