EssentialCSharp
EssentialCSharp copied to clipboard
Incorrectly invoking Async methods from Shares\Program.cs
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