S4457 should not fire when overriding an async method

The following method generates warning S4457 because it contains synchronous parameter validation. However, it can’t be changed to the recommended pattern because it is overriding an async method in the base class.

public override async Task Invoke(IOwinContext context)
{
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }
            //Do async stuff here...
}

EDIT: Sorry, ignore this, async keyword can still be removed and then the pattern followed.

1 Like

Hi @paulhickman,

Glad to see you figured it out :smiley:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.