U
U
Uncle Bogdan2021-06-06 11:50:00
C++ / C#
Uncle Bogdan, 2021-06-06 11:50:00

How to remove async if not needed, but required?

Tipo I do not need asynchronous execution, but then I can not get html.
.Result causes a deadlock.
Because of async in general, everything becomes bad in other threads. There is no async method for getting html. What's the catch?

The code:

private async void GetHTMLFromWebBrowser()
        {
            html = await browser.GetSourceAsync(); // как без await жить?
        }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Vladimir Korotenko, 2021-06-06
@motkot

Async.getAwaiter().getResult();
Where async is any asynchronous method

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question