semihokur / AsyncFixer

Advanced async/await Diagnostics and CodeFixes for C#
Apache License 2.0
165 stars 11 forks source link

Question: How to fix this AsyncFixer03 issue? #16

Closed ryanbuening closed 2 years ago

ryanbuening commented 3 years ago

I have the following logic in my Blazor app. How could I resolve this AsyncFixer03 issue?

image

protected override void OnInitialized()
{
    _appState.StateChanged += async (Source, Property) => await AppState_StateChanged(Source, Property);
}
// StateChanged is an event handler that takes a component and a string to denote which property changed
public event Action<ComponentBase, string> StateChanged;
gcstarr commented 3 years ago

Having the same issue; event handlers require a void return type.

AppDomain.CurrentDomain.ProcessExit += async (_, _) =>
            {
                shutdownStarted.Set();
                await shutdownComplete.WaitAsync();
            };

Could we get a way to suppress these warning individually via comment?

semihokur commented 2 years ago

Sorry about looking into this so late! I just fixed it and v1.6.1 will have the fix. I hope to release that in a week.

mosoftwareenterprises commented 1 year ago

Hi @semihokur any news on this fix being released? Thanks for a great project, it is very helpful.