@@ -61,6 +61,7 @@ public override int Execute()
6161 return Directory . Exists ( fullPath ) ? MsbuildProject . GetProjectFileFromDirectory ( fullPath ) . FullName : fullPath ;
6262 } ) ;
6363
64+ // Add projects to the solution
6465 AddProjectsToSolutionAsync ( fullProjectPaths , CancellationToken . None ) . GetAwaiter ( ) . GetResult ( ) ;
6566 return 0 ;
6667 }
@@ -120,7 +121,6 @@ private async Task AddProjectsToSolutionAsync(IEnumerable<string> projectPaths,
120121 SlnFileFactory . DefaultBuildTypes . ToList ( ) . ForEach ( solution . AddBuildType ) ;
121122 }
122123
123-
124124 foreach ( var projectPath in projectPaths )
125125 {
126126 // TODO: Remove this when we have a better way to handle this
@@ -150,12 +150,12 @@ private void AddProject(SolutionModel solution, string fullProjectPath, Solution
150150 }
151151
152152 ProjectInstance projectInstance = new ProjectInstance ( projectRootElement ) ;
153- SolutionProjectModel project ;
154153
155- // Handle guid
156154 string projectTypeGuid = solution . ProjectTypes . FirstOrDefault ( t => t . Extension == Path . GetExtension ( fullProjectPath ) ) ? . ProjectTypeId . ToString ( )
157155 ?? projectRootElement . GetProjectTypeGuid ( ) ?? projectInstance . GetDefaultProjectTypeGuid ( ) ;
158156
157+ SolutionProjectModel project ;
158+
159159 try
160160 {
161161 project = solution . AddProject ( solutionRelativeProjectPath , projectTypeGuid , solutionFolder ) ;
@@ -196,17 +196,7 @@ private void AddProject(SolutionModel solution, string fullProjectPath, Solution
196196 project . AddProjectConfigurationRule ( new ConfigurationRule ( BuildDimension . BuildType , solutionBuildType , "*" , projectBuildType ) ) ;
197197 }
198198
199- // Get referencedprojects from the project instance
200- //var referencedProjectsFullPaths = projectInstance.EvaluatedItemElements
201- // .Where(item => item.ItemType == "ProjectReference")
202- // .Select(item => item.Include)
203- // .Select(item => Path.GetFullPath(item, Path.GetDirectoryName(fullProjectPath)))
204- // .ToList();
205-
206- //foreach (var referencedProjectFullPath in referencedProjectsFullPaths)
207- //{
208- // var referencedProjectRelativePath = Path.GetRelativePath(_solutionFileFullPath, referencedProjectFullPath);
209- //}
199+
210200
211201 Reporter . Output . WriteLine ( CliStrings . ProjectAddedToTheSolution , solutionRelativeProjectPath ) ;
212202 }
0 commit comments