EssentialCSharp icon indicating copy to clipboard operation
EssentialCSharp copied to clipboard

Incorrectly invoking Async methods from Shares\Program.cs

Open MarkMichaelis opened this issue 5 years ago • 0 comments

When running Shared\Program.cs from any project (the launcher that calls each source file, the invocation doesn't wait for an async method to complete.

Line Shared\Program.cs (93) checks for an STAThreadAttribute but neglects to check for the System.Runtime.CompilerServices.AsyncStateMachineAttribute. When this attribute exists, the InvokeMethodUsingReflection() method needs to wait for the result (handling Task, Task<T>, ValueTask<T>, and IAsyncEnumerable<T> returns. See line 67

MarkMichaelis avatar Mar 26 '20 00:03 MarkMichaelis