dotnet-api-docs icon indicating copy to clipboard operation
dotnet-api-docs copied to clipboard

app.config example demonstrate configuration for the wrong class

Open hmccsGitHub opened this issue 4 months ago • 1 comments

Type of issue

Missing information

Description

In the "Remarks" section there is an xml example for "adding" a "listener". This example uses the "System.Diagnostics.TextWriterTraceListener" class. As far as remarks go, it provides general insights with adding a trace listener to the app.config; however it would be more useful if trace listener class used was the same one under discussion, namely the "System.Diagnostics.DefaultTraceListener".

What would be useful here (and for any feature that can be configure via code or configuration) would be a relevant entry in the "Example" section discussing this approach for this class.

While "remarks" may be general in nature, it would seem useful to ensure examples presented anywhere in a article are referencing as closely as possible to items under discussion.

BTW: Reason comes up because there seems to be no valid description of what "initializeData" values are acceptable for the "DefaultTraceListener" class as it applies to the "app.config" requirements. As of today (2025-09-16) Bing/Copilot searches are providing erroneous details around this particular XML attribute as it applies to this class (says if for declaring a log path, but fails; a value of "All" works, but "None" fails. What does this class need in the app.config?). Visual Studio Intellisense will help for coding against this class, but is no help usually for the app.config.

Page URL

https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.defaulttracelistener?view=net-9.0

Content source URL

https://github.com/dotnet/dotnet-api-docs/blob/main/xml/System.Diagnostics/DefaultTraceListener.xml

Document Version Independent Id

5912e9e4-a59b-d98b-722e-052ffe50b785

Platform Id

b07d91a5-f397-c5c7-ae24-3f047e33aefa

Article author

@dotnet-bot

hmccsGitHub avatar Sep 16 '25 22:09 hmccsGitHub