Skip to content

Commit 6c52de9

Browse files
authored
Merge pull request #21566 from github/redsun82/csharp-opt-out-of-dotnet-telemetry
C#: Opt out of dotnet CLI telemetry
2 parents c579ec9 + 14b3f62 commit 6c52de9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

csharp/extractor/Semmle.Extraction.CSharp.DependencyFetching/IDotNetCliInvoker.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,18 @@ internal interface IDotNetCliInvoker
1212

1313
/// <summary>
1414
/// A minimal environment for running the .NET CLI.
15-
///
15+
///
1616
/// DOTNET_CLI_UI_LANGUAGE: The .NET CLI language is set to English to avoid localized output.
1717
/// MSBUILDDISABLENODEREUSE: To ensure clean environment for each build.
1818
/// DOTNET_SKIP_FIRST_TIME_EXPERIENCE: To skip first time experience messages.
19+
/// DOTNET_CLI_TELEMETRY_OPTOUT: To skip any dotnet telemetry: it's unnecessary and can even cause issues.
1920
/// </summary>
2021
static ReadOnlyDictionary<string, string> MinimalEnvironment { get; } = new(new Dictionary<string, string>
2122
{
2223
{"DOTNET_CLI_UI_LANGUAGE", "en"},
2324
{"MSBUILDDISABLENODEREUSE", "1"},
24-
{"DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true"}
25+
{"DOTNET_SKIP_FIRST_TIME_EXPERIENCE", "true"},
26+
{"DOTNET_CLI_TELEMETRY_OPTOUT", "1"}
2527
});
2628

2729
/// <summary>

0 commit comments

Comments
 (0)