public static Solution Load(string fileName)
{
var solution = SerializedObject.Deserialize<Solution>(fileName);
solution.CurrentDirectory = (Path.GetDirectoryName(fileName) + Platform.DirectorySeperator).ToPlatformPath();
Console.WriteLine("Solution directory is " + solution.CurrentDirectory);
foreach (var projectReference in solution.ProjectReferences)
{
var proj = LoadProject(solution, projectReference);
// todo null returned here we need a placeholder.
if (proj != null)
{
solution.Projects.InsertSorted(proj);
}
}
foreach (var project in solution.Projects)
{
project.ResolveReferences();
project?.ToolChain?.ProvisionSettings(project);
}
solution.Name = Path.GetFileNameWithoutExtension(fileName);
solution.StartupProject = solution.Projects.SingleOrDefault(p => p.Name == solution.StartupItem);
return solution;
}