Closed FroggieFrog closed 1 year ago
The current version does produce a deadlock when used in a UI thread. This PR fixes fixes that issue.
I tested this with a WinForms (.NET 4.8 and .NET 7) and a MAUI (.NET 7) app. When running inside a Console app (.NET 7) everything worked for me.
It is not a nice solution but works.
More information: https://blog.stephencleary.com/2013/01/async-oop-2-constructors.html
Proper solution: Factory pattern
Used Hack that works: https://stackoverflow.com/questions/23048285/call-asynchronous-method-in-constructor#comment55917952_28737702
Thank you
The current version does produce a deadlock when used in a UI thread. This PR fixes fixes that issue.
I tested this with a WinForms (.NET 4.8 and .NET 7) and a MAUI (.NET 7) app. When running inside a Console app (.NET 7) everything worked for me.
It is not a nice solution but works.
More information: https://blog.stephencleary.com/2013/01/async-oop-2-constructors.html
Proper solution: Factory pattern
Used Hack that works: https://stackoverflow.com/questions/23048285/call-asynchronous-method-in-constructor#comment55917952_28737702