Description
After publishing the application with Native AOT, PuppeteerSharp.LaunchAsync fails on the first run.
Launching the browser throws the following exception:
Failed to launch browser! at PuppeteerSharp.States.ProcessStartingState.<StartCoreAsync>d__10.MoveNext() + 0x50e
--- End of stack trace from previous location ---
at PuppeteerSharp.States.ProcessStartingState.<StartCoreAsync>d__10.MoveNext() + 0x77c
--- End of stack trace from previous location ---
at PuppeteerSharp.Launcher.<LaunchAsync>d__8.MoveNext() + 0x2ac
--- End of stack trace from previous location ---
at PuppeteerSharp.Launcher.<LaunchAsync>d__8.MoveNext() + 0x118a
However, after closing the executable and launching it again, it works normally without any code changes.
Here is my code:
using var browser = await Puppeteer.LaunchAsync(new LaunchOptions
{
Headless = true,
ExecutablePath = @"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe",
Args = ["--no-sandbox", "--headless=new", "--disable-gpu"]
});
Environment
- OS: Windows 11
- .NET: 10.0
Description
After publishing the application with Native AOT,
PuppeteerSharp.LaunchAsyncfails on the first run.Launching the browser throws the following exception:
However, after closing the executable and launching it again, it works normally without any code changes.
Here is my code:
Environment