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.
I found it somewhat misleading, that the deadlock example in 1835 is referencing ASP.NET, as this scenario was true for classical ASP.NET, but is not applicable for ASP.NET Core as explained by Stephen Cleary in this blog post. The title stating 'single-threaded environment' might also be somewhat confusing: Yes, this rule references special environments with their SynchronizationContext forcing a push-back of the continuation to a special dedicated context (rather than tacking a thread from the thread pool to continue with), but it still might be confusing, as it is possible to create multiple Tasks / Threads within e.g. WPF, so 'single-threaded' might not be the best wording.
I also created a new rule 1840, to explain the fallacies when using
ValueTask
/ValueTask<T>
and advising to either directly await these special types or using.AsTask()
to retrieve aTask
/Task<T>
.