Skip to content

C#: Opt out of dotnet CLI telemetry#21566

Open
redsun82 wants to merge 1 commit intomainfrom
redsun82/csharp-opt-out-of-dotnet-telemetry
Open

C#: Opt out of dotnet CLI telemetry#21566
redsun82 wants to merge 1 commit intomainfrom
redsun82/csharp-opt-out-of-dotnet-telemetry

Conversation

@redsun82
Copy link
Contributor

Add DOTNET_CLI_TELEMETRY_OPTOUT=1 to the minimal environment used for all dotnet invocations. The telemetry is unnecessary and may even be causing segfaults in some cases.

Add `DOTNET_CLI_TELEMETRY_OPTOUT=1` to the minimal environment used for
all `dotnet` invocations. The telemetry is unnecessary and may even be
causing segfaults in some cases.
@redsun82 redsun82 requested a review from a team as a code owner March 24, 2026 13:19
Copilot AI review requested due to automatic review settings March 24, 2026 13:19
@github-actions github-actions bot added the C# label Mar 24, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds an additional environment variable to the centralized “minimal environment” used for running dotnet in the C# dependency fetching/extractor tooling, opting out of .NET CLI telemetry.

Changes:

  • Extend IDotNetCliInvoker.MinimalEnvironment to include DOTNET_CLI_TELEMETRY_OPTOUT=1.
  • Update the associated XML documentation to describe the new variable.

/// DOTNET_CLI_UI_LANGUAGE: The .NET CLI language is set to English to avoid localized output.
/// MSBUILDDISABLENODEREUSE: To ensure clean environment for each build.
/// DOTNET_SKIP_FIRST_TIME_EXPERIENCE: To skip first time experience messages.
/// DOTNET_CLI_TELEMETRY_OPTOUT: To skip any dotnet telemetry: it's unnecessary and can even cause issues.
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doc comment wording is a bit awkward (double colon). Consider rephrasing to something like “To opt out of .NET CLI telemetry; it’s unnecessary and can cause issues.”

Suggested change
/// DOTNET_CLI_TELEMETRY_OPTOUT: To skip any dotnet telemetry: it's unnecessary and can even cause issues.
/// DOTNET_CLI_TELEMETRY_OPTOUT: Opts out of .NET CLI telemetry, which is unnecessary and can cause issues.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

@hvitved hvitved left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks plausible to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants