private ErrorCode GenerateSolution()
        {
            if (SkipGenerateCommand)
            {
                return(ErrorCode.Success);
            }

            Log.Debug("Config = " + SolutionConfigFile.FullName);
            Log.Debug("Define Symbols =");
            if (defineSymbols.Count > 0)
            {
                Log.IndentedCollection(defineSymbols, Log.Debug);
            }
            Log.Debug("Variables =");
            if (Variables.Count > 0)
            {
                Log.IndentedCollection(Variables, kvp => $"{kvp.Key} => {kvp.Value}", Log.Debug);
            }

            try
            {
                solution = GetGenerator();
                solution.GenerateSolution(
                    MasterConfiguration,
                    defineSymbols.ToArray(),
                    PropertyOverrides.ToArray(),
                    string.IsNullOrEmpty(BuildConfiguration) ? null : new[] { BuildConfiguration });

                // If MasterConfiguration was null or empty, the generator will select a default.
                MasterConfiguration = solution.MasterConfiguration;
            }
            catch (Exception ex)
            {
                Log.Error("{0}", ex.ToString());
                return(ErrorCode.GeneratorException);
            }

            File.WriteAllText(Path.Combine(solution.Solution.OutputDir, solution.Solution.Name + ".sln.config"),
                              "MasterConfiguration=" + MasterConfiguration);

            return(ErrorCode.Success);
        }