prodot / ReCommended-Extension

Code analysis improvements and context actions
Apache License 2.0
59 stars 11 forks source link

Redundant Captured Context (ConfigureAwait(false)) suggested incorrectly #41

Closed meganaut closed 5 years ago

meganaut commented 5 years ago

I have a case similar to this example:

async Task<bool> SomeFunction()
{
    var someLock = await GetTheLock();

    try {
        return await SomeCodeThatMayThrow();
    }
    finally {
        await someLock.Release();
    }
}

I believe it is incorrect to recommend the return await SomeCodeThatMayThrow line should have ConfigureAwait(false) because the finally section will run afterwards.

michael-damatov commented 5 years ago

This issue has been fixed with the Release 3.5.0. Please install the latest version.