Puppeteer Sharp hangs on LaunchAsync with VB.net

75 views Asked by At

I would like to convert a local html file to a pdf using Puppeteer Sharp with a local chrome.exe file and VB.net.

I'm using "Chrome for Testing" 119.0.6045.105 and PuppeteerSharp 13.0.2

Thats my Code:

Public Async Sub RenderPdf(openFolder As Boolean)

        ...
    
        Dim opt = New LaunchOptions()
        opt.Headless = True
        opt.ExecutablePath = IO.Path.Combine(Application.StartupPath, "chrome-win64", "chrome.exe")
        Dim bro = Await Puppeteer.LaunchAsync(opt)
    
        Dim p = Await bro.NewPageAsync()
    
        Await p.GoToAsync(htmlInPath)
        Await p.EvaluateExpressionHandleAsync("document.fonts.ready")
        Await p.PdfAsync(pdfOutPath)

End Sub

The task seems to stuck at Puppeteer.LaunchAsync(opt). The Visual Studio Task Window (under Debugging -> Window -> Tasks) displays that the task PuppeteerSharp.Transport.WebSocketTransport.GetResponseAsync(cancellationToken) is waiting.

The Windows Taskmanager is showing up that 6 Chrome tasks are running under the task of my VB.net application, but all the tasks are using 0% CPU load.

I tried to download a chrome instance via the DownloadAsync() methiod, but when i try this, it seems to stuck on the download method.

I'm expecting that doing the conversion including starting the chrome instance doensn't take longer than 1 minute

0

There are 0 answers