Rule Definition
ConfigureAwait(false) is used to avoid forcing the callback to be invoked on the original context or scheduler. It helps in avoiding Context Switching, preventing deadlocks and improving performance.
Remediation
Use ConfigureAwait(false) in Library Classes awaiting tasks
Violation Code Sample
var res = await httpClient.GetAsync(url); // Violation
Fixed Code Sample
var res = await httpClient.GetAsync(url).ConfigureAwait(false); // Violation Fixed
Reference
https://devblogs.microsoft.com/dotnet/configureawait-faq/#why-would-i-want-to-use-configureawaitfalse
Related Technologies
Technical Criterion
CWE-1088 - Synchronous Access of Remote Resource without Timeout
About CAST Appmarq
CAST Appmarq is by far the biggest repository of data about real IT systems. It's built on thousands of analyzed applications, made of 35 different technologies, by over 300 business organizations across major verticals. It provides IT Leaders with factual key analytics to let them know if their applications are on track.