Skip to content

Commit 78a6b10

Browse files
authored
Test for both .sln and .slnx when searching for solution file (#2764)
1 parent d8eea0d commit 78a6b10

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliGenerator.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ public abstract class DotNetCliGenerator : GeneratorBase
1212
{
1313
private static readonly string[] ProjectExtensions = { ".csproj", ".fsproj", ".vbroj" };
1414

15+
private static readonly string[] SolutionExtensions = { ".sln", ".slnx" };
16+
1517
[PublicAPI] public string TargetFrameworkMoniker { get; }
1618

1719
[PublicAPI] public string CliPath { get; }
@@ -111,7 +113,7 @@ protected override void GenerateBuildScript(BuildPartition buildPartition, Artif
111113
private static bool IsRootSolutionFolder(DirectoryInfo directoryInfo)
112114
=> directoryInfo
113115
.GetFileSystemInfos()
114-
.Any(fileInfo => fileInfo.Extension == ".sln" || fileInfo.Name == "global.json");
116+
.Any(fileInfo => SolutionExtensions.Contains(fileInfo.Extension) || fileInfo.Name == "global.json");
115117

116118
private static bool IsRootProjectFolder(DirectoryInfo directoryInfo)
117119
=> directoryInfo

0 commit comments

Comments
 (0)