public void Execute(Solution solution, CodeDirectory codeDirectory) { foreach (var reference in codeDirectory.References) { var project = solution.GetProject(codeDirectory.Project.AssemblyName); var referencedProject = solution.FindProject(reference.Name); if (referencedProject != null) { project.AddReference(new ProjectReference { Project = referencedProject, RelativePathToProject = relativePathGenerator.GeneratePath(project.Path, referencedProject.GeneratedProjectFilePath) }); } else { var assemblyReference = new AssemblyReference {Name = reference.Name, HintPath = reference.HintPath}; assemblyReference.HintPath = assemblyReference.HintPath; project.AddReference(assemblyReference); } } codeDirectory.Directories.Each(x => Execute(solution, x)); }
public void AddReference(AssemblyReference assemblyReference) { if (assemblyReference == null) throw new ArgumentNullException("assemblyReference"); assemblyReferences.Add(assemblyReference); }