How to disable telemetry such as NetSecurityTelemetry #96842
-
Whilst debugging code I've come across with .NET's source throwing exception and using NetSecurityTelemetry.Log.IsEnabled() to choose code path which would log stuff via that NetSecurityTelemetry. This can't be the only part of the library that uses this logging. I've set DOTNET_CLI_TELEMETRY_OPTOUT=1 and restarted VS 2022 but that had no effect on this, as it seeminly affects only CLI, How can this and all other unwanted logging get disabled, ideally programmatically? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
NetSecurityTelemetry is based on EventSource. EventSource tracing is disabled by default. It gets enabled when a listener registers for given event. An example of such listener is dotnet-trace tool. |
Beta Was this translation helpful? Give feedback.
-
Does it get automatically enabled in Debug mode running under VS 2022? |
Beta Was this translation helpful? Give feedback.
Yes. the managed Visual Studio Debugger enables number of event sources to implement various debugger features.