From 1a8296f86ead19359c842a36ebd22b223695afa2 Mon Sep 17 00:00:00 2001 From: Andrey Akinshin Date: Fri, 13 Aug 2021 16:54:50 +0300 Subject: [PATCH] Better snap support, fix #1753 --- .../Toolchains/DotNetCli/DotNetCliCommandExecutor.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliCommandExecutor.cs b/src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliCommandExecutor.cs index 09f5db8292..1d70985735 100644 --- a/src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliCommandExecutor.cs +++ b/src/BenchmarkDotNet/Toolchains/DotNetCli/DotNetCliCommandExecutor.cs @@ -120,7 +120,8 @@ private static string GetDefaultDotNetCliPath() { string parentPath = parentProcess.MainModule?.FileName ?? string.Empty; // sth like /snap/dotnet-sdk/112/dotnet and we should use the exact path instead of just "dotnet" - if (parentPath.StartsWith("/snap/", StringComparison.Ordinal)) + if (parentPath.StartsWith("/snap/", StringComparison.Ordinal) && + parentPath.EndsWith("/dotnet", StringComparison.Ordinal)) { return parentPath; }