public string RunTemplate() { var targetFile = GetMetadata().GetFilePath(); var content = File.Exists(targetFile) ? File.ReadAllText(targetFile) : "Microsoft Visual Studio Solution File, Format Version 12.00" + Environment.NewLine + "# Visual Studio 14" + Environment.NewLine + "VisualStudioVersion = 14.0.25420.1" + Environment.NewLine + "MinimumVisualStudioVersion = 10.0.40219.1"; var slnFile = new SlnFile(targetFile, content); slnFile.GetOrCreateGlobalNode("Global", out var globalNode); globalNode.GetOrCreateSection( name: "SolutionConfigurationPlatforms", value: "preSolution", childNodes: new List <Node> { new KeyValueNode("Debug|Any CPU", "Debug|Any CPU"), new KeyValueNode("Release|Any CPU", "Release|Any CPU") }, sectionNode: out var solutionConfigurationPlatforms); globalNode.GetOrCreateSection( name: "ProjectConfigurationPlatforms", value: "postSolution", childNodes: new List <Node>(), sectionNode: out var projectConfigurationPlatforms); globalNode.GetOrCreateSection( name: "SolutionProperties", value: "preSolution", childNodes: new List <Node> { new KeyValueNode("HideSolutionNode", "FALSE") }, sectionNode: out _); globalNode.GetOrCreateSection( name: "NestedProjects", value: "preSolution", childNodes: new List <Node>(), sectionNode: out _); SyncProjectsAndFolders( slnFile: slnFile, slnParent: null, modelParent: null, modelFolders: Model.Folders, projectConfigurationPlatforms: projectConfigurationPlatforms.ChildNodes, solutionConfigurationPlatforms: solutionConfigurationPlatforms.ChildNodes .OfType <KeyValueNode>() .Select(x => x.Key) .ToArray()); return(slnFile.ToString()); }