question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Something happens and .net will no longer run

See original GitHub issue

I’m using the component like this…

await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision);

byte[] pdfBytes;

PuppeteerSharp.Browser browser = null;
Page page = null;

try
{
    browser = await Puppeteer.LaunchAsync(new LaunchOptions { Headless = true });

    page = await browser.NewPageAsync();

    await page.SetViewportAsync(new ViewPortOptions()
    {
        Height = 1000,
        Width = 1400
    });

    await page.GoToAsync("http://localhost:3000/export");

    await page.WaitForSelectorAsync("#btnDownload");

    pdfBytes = await page.PdfDataAsync(new PdfOptions
    {
        PrintBackground = true,
        Width = 1400.ToString() + "px",
        Height = 1000.ToString() + "px"
    });
}
finally
{
    if (!page?.IsClosed ?? false)
    {
        await page?.CloseAsync();
    }

    page?.Dispose();

    if (!browser?.IsClosed ?? false)
    {
        await browser?.CloseAsync();
    }

    browser?.Dispose();
}

Somewhat regularly, .net won’t start. Sometimes I get a lengthy error log. I think I saw on another forum that the web server service was clashing with PuppeteerSharp. I have to reboot my machine in order to get things back to normal.

I’m running on Mac OS.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
kblokcommented, Oct 18, 2019

The lengthy error might be useful.

0reactions
kblokcommented, Dec 18, 2019

Closed due to inactivity. Feel free to reopen it if needed.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Something happens and .net will no longer run · Issue #1307
I'm using the component like this... await new BrowserFetcher().DownloadAsync(BrowserFetcher.DefaultRevision); byte[] pdfBytes ...
Read more >
Fix .NET Framework 'This application could not be started'
When you attempt to run a .NET Framework application, you may receive the "This application could not be started" error message.
Read more >
I'm lost. What happened to ASP.NET MVC 5?
NET Core 3.0 will now only run on the upcoming .NET Core 3.0 (so it will no-longer run on the .NET Framework 4.7.x)....
Read more >
Fix "Aw, Snap!" page crashes and other page loading errors
Step 1: Check your internet connection. Make sure your phone or tablet is connected to Wi-Fi or mobile data. Try reloading the tab...
Read more >
The Good and the Bad of .NET Framework Programming
NET is a software development framework and ecosystem designed and supported by ... Stable version and long-term support for 3 years.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found