Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PuppeteerSharp in LA
#2
DoScreenshot, being async, returns when started await. The caller does not await it, therefore the process exits.

Simplified example. Incorrect.
 
Code:
Copy      Help
static async void DoScreenshot(string url) {
    await Task.Run(() => { dialog.show("task"); });

}

DoScreenshot("https://www.libreautomate.com/");

Correct.
 
Code:
Copy      Help
static async Task DoScreenshot(string url) {
    await Task.Run(() => { dialog.show("task"); });

}

await DoScreenshot("https://www.libreautomate.com/");


Messages In This Thread
PuppeteerSharp in LA - by Davider - 03-13-2024, 11:25 PM
RE: PuppeteerSharp in LA - by Gintaras - 03-14-2024, 05:10 AM
RE: PuppeteerSharp in LA - by Davider - 03-14-2024, 11:45 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)