Skip to content

Fix S2674 FN: Add support for ConfigureAwait #6517

Closed
@martin-strecker-sonarsource

Description

@martin-strecker-sonarsource
Contributor

Description

S2674 does not take ConfigureAwait into account.

Repro steps

  await stream.ReadAsync(array, 0, (int)stream.Length);                       // Raises S2674
  await stream.ReadAsync(array, 0, (int)stream.Length).ConfigureAwait(false); // Does not

Expected behavior

Raise S2674 if ReadAsync is configured to continue on the current synchronization context.

Actual behavior

Does not raise.

Known workarounds

No

Metadata

Metadata

Labels

False NegativeRule is NOT triggered when it should be.

Type

No type

Projects

No projects

Relationships

None yet

    Development

    Participants

    @martin-strecker-sonarsource@cristian-ambrosini-sonarsource

    Issue actions

      Fix S2674 FN: Add support for ConfigureAwait · Issue #6517 · SonarSource/sonar-dotnet