dotnet / dotnet/dotnet-api-docs
TraceSwitch value is not read from config
- Dominant language
- C#
- Stars
- 949
- Forks
- 1.7k
- Avg merge
- 3d 27m
- Merged PRs (30d)
- 49
Description
### Description
Unlike what [docs](https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.traceswitch.-ctor?view=net-6.0) TraceSwitch value is not read from app.config.
I have created a repro here: https://github.com/aliostad/TraceSwitchDoesNotWork
### Reproduction Steps
Add system.diagnostics switch to the config and then in the code create a `TraceSwitch` with that name. Value is not read.
As in the repro https://github.com/aliostad/TraceSwitchDoesNotWork
### Expected behavior
Reading value Error (1)
### Actual behavior
Reading value Off (0) - perhaps just the default
### Regression?
I tried netcoreapp3.1 and it was the same
### Known Workarounds
None
### Configuration
.NET 6.0 on mac, x64
### Other information
_No response_
Contributor guide
Assessment
This issue has not been assessed yet.