private void GenerateFolders(StreamWriter writer, Resolver resolver) { Strings projectFiles = _project.GetSourceFilesForConfigurations(_projectConfigurationList); // Add source files ProjectDirectory rootDirectory = new ProjectDirectory(null, _project.SourceRootPath); foreach (string file in projectFiles) { string relativeFile = GetProperRelativePathToSourcePath(file); relativeFile = relativeFile.Trim('.', '\\', '/'); string[] splitFile = relativeFile.Split('\\', '/'); ProjectDirectory directory = rootDirectory; for (int i = 0; i < splitFile.Length - 1; ++i) { directory = directory.GetSubDirectory(splitFile[i]); } directory.AddFile(file); } Write(Template.Project.ProjectItemGroupBegin, writer, resolver); foreach (ProjectDirectory subDirectory in rootDirectory.Directories) { WriteProjectDirectory(writer, subDirectory, " ", false); } Write(Template.Project.ProjectItemGroupEnd, writer, resolver); }