[release/8.0-staging] [wasm][debugger] Fixes exception while debugging on Chrome as IDE #97871
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backport of #97838 to release/8.0-staging
/cc @thaystg
Customer Impact
A customer reported it by email. Related to dotnet/AspNetCore.Docs#30443
He was testing the documentation and got this behavior when trying to debug on Chrome. If there is a breakpoint set from another debugging session, when the customer presses Alt-Shift-D on Blazor the DevTools is opened but then a crash happens and in the Blazor console app it can see this exception:
Regression
I don't know if it works before .NET 8 or something has changed on browser that is causing this race condition. But this is a scenario that was used to work.
Testing
Manually tested.
Risk
Low risk, only looping in a static list and not a list that can be changed while we are looping.