Skip to content

Conversation

steveharter
Copy link
Contributor

Fixes #104457

I used the test from the issue above to verify the fix plus added a loop around app.InitializeComponent() in Main(). There was no need to show the WPF-based window. This repro'd the InvalidOperationException nearly 100% of the time when running under Visual Studio in the debugger (no breakpoints were necessary). However, I was not able to repro without debug mode and was also not able to repro in console app (in a loop of several hundred runs) or in a new unit test.

The fix is to apply the same concurrency semantics as elsewhere in the file when enumerating TraceListeners.

Copy link
Member

@ericstj ericstj left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Race condition during TraceSource Initialization/Refresh
2 participants