Reputation: 1
Every time I run this command now:
dotnet new console -o a
I get this:
An update for template pack Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.0
is available.
install command: dotnet new -i Microsoft.DotNet.Common.ProjectTemplates.5.0::5.0.1
I don't want DotNet checking for updates, ever, and certainly not "patch" level updates. How do I disable this? I tried $env:DOTNET_CLI_TELEMETRY_OPTOUT = 1
, but it doesn't seem to change the update behavior.
Upvotes: 1
Views: 229
Reputation: 15223
Just to clarify, this isn't .NET checking for updates to .NET itself, it's checking for updates to the templates. Having stale templates could have a security implication if a template generates code that's vulnerable.
But your concern stands: it's making network connections to machines not under your control and sending data that you might consider private.
I am looking at the source code that implements this check and there doesn't appear to be a way to configure this at this time.
The error message is printed by TemplateInvocationAndAcquisitionCoordination.DisplayUpdateMessage
. Neither that file, nor the actual checker in TemplateUpdateChecker
seem to have a way to configure this check.
I think you should file a bug against dotnet/templating repo requesting this.
Upvotes: 3