Task is not completing second time [Intermittent Issue] – Async/ Await

早过忘川 提交于 2019-12-02 01:21:47
noseratio

"Location 1" is printed but not "Location 2". What is your suggestion to overcome this? Were you able to reproduce this issue?

I haven't tried to repro, but like I said in the comment, it's obvious that either DocumentCompleted or window.onload is not getting fired for that particular URL. That's possible if the page cannot be fully loaded, or e.g. if the URL is invalid or the server becomes unreachable. That's what the time-out logic is for.

Put one more trace at the beginning of documentCompletedHandler, and one more inside onloadEventHandler:

onloadEventHandler = (s, e) => { Log("inside onloadEventHandler");
    onloadTcs.TrySetResult(true); }

See what gets fired and what doesn't.

Besides, your should also implement WebBrowser Feature Control to enable the modern IE features. This also often affects how web page are loaded. Copy SetFeatureBrowserEmulation from here.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!