Identify an async Void method through reflection

293 Views Asked by At

I'm analyzing a class through reflection and I want to check if a method is actually a async void method.

I have a MethodInfo object, and through it I can inspect the ReturnType property but that just says Void. Looking around I can't find a way to find to check if it's an async though.

Is there a way to see if a method is async void? Surely there must be?

1

There are 1 best solutions below

1
On

async is not part of the method signature, and as such you won't be able to determine whether the method is async or not from it's external API.