When you (synchronously) block asynchronous code, you are faced with a deadlock problem .
Follow these guidelines:
- Use
ConfigureAwait(false) , when possible, in your library methods (e.g. Load ). - Use
async to the end; do not block async code.
In your case, it looks like Load can be called part of the launch. This is a bit tricky to do asynchronously (since constructors cannot be async ). However, you should be able to make it work using asynchronous lazy initialization .
source share