From 69dc50fcf2380dc125f0e34fdaea395fe85456fa Mon Sep 17 00:00:00 2001 From: Hecate2 <2474101468@qq.com> Date: Mon, 26 Feb 2024 12:52:45 +0800 Subject: [PATCH] do not include .cs in bin/sc --- src/Neo.Compiler.CSharp/CompilationEngine.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Neo.Compiler.CSharp/CompilationEngine.cs b/src/Neo.Compiler.CSharp/CompilationEngine.cs index 9d46344a6..951a57b5e 100644 --- a/src/Neo.Compiler.CSharp/CompilationEngine.cs +++ b/src/Neo.Compiler.CSharp/CompilationEngine.cs @@ -172,8 +172,9 @@ public Compilation GetCompilation(string csproj) { string folder = Path.GetDirectoryName(csproj)!; string obj = Path.Combine(folder, "obj"); + string binSc = Path.Combine(Path.Combine(folder, "bin"), "sc"); HashSet sourceFiles = Directory.EnumerateFiles(folder, "*.cs", SearchOption.AllDirectories) - .Where(p => !p.StartsWith(obj)) + .Where(p => !p.StartsWith(obj) && !p.StartsWith(binSc)) .GroupBy(Path.GetFileName) .Select(g => g.First()) .ToHashSet(StringComparer.OrdinalIgnoreCase);