public bool UpdateProjectReference(SolutionFile solution, Project project) { var localProjects = solution.GetProjectDictionary(); var referenceProjects = project.GetLocalDllReference(); var existingProjects = referenceProjects.Where(item => localProjects.ContainsKey(item.ProjectName)) .Select(item => new ExistingProjectResult { Project = localProjects[item.ProjectName], DllReference = item }).ToList(); foreach (var existingProjectResult in existingProjects) { project.UpdateProjectReference(existingProjectResult.Project, existingProjectResult.DllReference.EvaluatedInclude); } return(project.IsDirty); }