private ISolution ValidateAndParseSolution(
     ISolutionInspectorConfiguration configuration,
     RawArguments arguments,
     Func <string, Exception> reportError)
 {
     try
     {
         return(_solutionLoader.Load(arguments.SolutionFilePath, configuration.MsBuildParsing));
     }
     catch (SolutionNotFoundException)
     {
         throw reportError($"Given solution file '{arguments.SolutionFilePath}' could not be found.");
     }
     catch (InvalidProjectFileException ex)
     {
         s_logger.Error(ex, "Error while loading solution.");
         throw reportError(
                   $"Given solution file '{arguments.SolutionFilePath}' contains an invalid project file '{ex.ProjectFile}' " +
                   "(for detailed error information see the log file 'SolutionInspector.log').");
     }
     catch (Exception ex)
     {
         s_logger.Error(ex, "Error while loading solution.");
         throw reportError($"Unexpected error when loading solution file '{arguments.SolutionFilePath}': {ex.Message} (for further details see the" +
                           "log file 'SolutionInspector.log').");
     }
 }
 public ParsedArguments(
     ISolution solution,
     IRuleCollection rules,
     ViolationReportFormat reportFormat,
     [CanBeNull] string reportOutputFile,
     ISolutionInspectorConfiguration configuration)
 {
     Solution         = solution;
     Rules            = rules;
     ReportFormat     = reportFormat;
     ReportOutputFile = reportOutputFile;
     Configuration    = configuration;
 }