Intentional Blocking On ValueTask - prodot/ReCommended-Extension GitHub Wiki

Warns that invoking .GetAwaiter().GetResult() for ValueTask or ValueTask<T> values might not block as intended.

Applies to

  • .GetAwaiter().GetResult() invoked for ValueTask and ValueTask<T> expressions.

Tip

A quick fix is available to insert the .AsTask(), effectively replacing .GetAwaiter().GetResult() with .AsTask().GetAwaiter().GetResult()

Note

The analyzer can be configured or deactivated in the ReSharper Options or Rider Settings dialog.

References

⚠️ **GitHub.com Fallback** ⚠️