public static FileAbstraction CreateAppConfig(SolutionConfiguration solutionConfiguration)
        {
            var mappings = new List<string>();

            if (!solutionConfiguration.InCodeSubscriptions)
            {
                foreach (var endpoint in solutionConfiguration.EndpointConfigurations)
                {
                    foreach (var message in endpoint.MessageHandlers.Where(m => !m.IsEvent))
                    {
                        mappings.Add(MakeMapping(TextPlaceholder.SharedProjectName, message.MessageTypeName,
                            endpoint.EndpointName));
                    }
                }
            }

            var mappingSection = string.Join("", mappings.ToArray());

            var appConfig = FileTemplate.Replace("{{messageMappings}}", mappingSection);

            return new FileAbstraction()
            {
                Name = "app.config",
                Content = appConfig,
            };
        }
        public string CreateSolution(IBuildBootstrappedSolutions bootstrapper, SolutionConfiguration configuration)
        {
            configuration.InCodeSubscriptions = true;
            foreach (var endpointConfiguration in configuration.EndpointConfigurations)
            {
                endpointConfiguration.InCodeSubscriptions = configuration.InCodeSubscriptions;
            }

            var solutionData = bootstrapper.BootstrapSolution(configuration);

            var solutionDirectory = SavePath + Guid.NewGuid();

            var solutionFile = SaveSolution(solutionDirectory, solutionData);

            InstallNuGetPackages(solutionDirectory, solutionData, solutionFile, NuGetExe);

            //AddReferencesToNugetPackages(solutionDirectory);

            var zipFilePath = solutionFile.Replace(".sln", ".zip");

            using (var zip = new ZipFile())
            {
                zip.AddDirectory(solutionDirectory, "Solution");
                zip.Save(zipFilePath);
            }

            return zipFilePath;
        }
        public static FileAbstraction CreateSolutionFile(SolutionConfiguration configuration)
        {
            var solutionName = "Ignited.NServiceBus" + configuration.NServiceBusVersion + "." + configuration.Transport.ToString();
            var solutionGuid = Guid.NewGuid();

            var projectIncludes =
                configuration.EndpointConfigurations
                    .Select(e => CreateProjectInclude(solutionGuid, e.ProjectGuid, e.EndpointName))
                    .ToList();

            var sharedProjectGuid = Guid.NewGuid();
            var consoleProjectGuid = Guid.NewGuid();

            projectIncludes.Add(CreateProjectInclude(solutionGuid, sharedProjectGuid, TextPlaceholder.SharedProjectName));
            projectIncludes.Add(CreateProjectInclude(solutionGuid, consoleProjectGuid, TextPlaceholder.ConsoleProjectName));

            var projectConfigurations =
                configuration.EndpointConfigurations
                    .Select(e => CreateProjectConfiguration(e.ProjectGuid))
                    .ToList();

            projectConfigurations.Add(CreateProjectConfiguration(sharedProjectGuid));
            projectConfigurations.Add(CreateProjectConfiguration(consoleProjectGuid));

            var solutionFileContent =
                SolutionFileTemplate
                    .Replace("{{projectIncludes}}", string.Join(Environment.NewLine, projectIncludes))
                    //.Replace("{{instructionsIncludes}}", CreateInstructionsFolder(solutionGuid))
                    .Replace("{{projectConfigurations}}", string.Join(Environment.NewLine, projectConfigurations));

            var solutionFile = new FileAbstraction()
            {
                Name = solutionName + ".sln",
                Content = solutionFileContent
            };

            return solutionFile;
        }