diff --git a/ICSharpCode.Decompiler/Solution/SolutionCreator.cs b/ICSharpCode.Decompiler/Solution/SolutionCreator.cs index 749a772c0..ea21a82a7 100644 --- a/ICSharpCode.Decompiler/Solution/SolutionCreator.cs +++ b/ICSharpCode.Decompiler/Solution/SolutionCreator.cs @@ -41,7 +41,7 @@ namespace ICSharpCode.Decompiler.Solution /// Thrown when is null or empty. /// Thrown when is null. /// Thrown when contains no items. - public static void WriteSolutionFile(string targetFile, IEnumerable projects) + public static void WriteSolutionFile(string targetFile, List projects) { if (string.IsNullOrWhiteSpace(targetFile)) { @@ -53,19 +53,17 @@ namespace ICSharpCode.Decompiler.Solution throw new ArgumentNullException(nameof(projects)); } - var projectList = projects.ToList(); - - if (!projectList.Any()) + if (!projects.Any()) { throw new InvalidOperationException("At least one project is expected."); } using (var writer = new StreamWriter(targetFile)) { - WriteSolutionFile(writer, projectList, targetFile); + WriteSolutionFile(writer, projects, targetFile); } - FixProjectReferences(projectList); + FixProjectReferences(projects); } static void WriteSolutionFile(TextWriter writer, List projects, string solutionFilePath) diff --git a/ILSpy/SolutionWriter.cs b/ILSpy/SolutionWriter.cs index 29e8db8b0..06d71e701 100644 --- a/ILSpy/SolutionWriter.cs +++ b/ILSpy/SolutionWriter.cs @@ -153,8 +153,8 @@ namespace ICSharpCode.ILSpy } else { - await Task.Run(() => SolutionCreator.WriteSolutionFile(solutionFilePath, projects)) - .ConfigureAwait(false); + await Task.Run(() => SolutionCreator.WriteSolutionFile(solutionFilePath, projects.ToList())) + .ConfigureAwait(false); } } catch (AggregateException ae)