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.

[Bug]: Setup will not work with .NET 4.8

See original GitHub issue

Playwright version

1.14

Operating system

Windows

What browsers are you seeing the problem on?

Chromium

Other information

No response

What happened? / Describe the bug

Running the program gave this error

Driver not found: C:\Users\user\Source\Repos\PlaywriteTest.playwright\node\win32_x64\playwright.cmd’

Code snippet to reproduce your bug

1. dotnet tool install --global Microsoft.Playwright.CLI
2. Create .NET 4.8 console app with the following code

using Microsoft.Playwright;
using System.Threading.Tasks;

namespace PlaywriteTest
{
    class Program
    {
        static async Task Main(string[] args)
        {
            await Go().ConfigureAwait(false);
        }

        public static async Task Go()
        {
            using (var playwright = await Playwright.CreateAsync())
            {
                var browser = await playwright.Chromium.LaunchAsync();
                var page = await browser.NewPageAsync();
                await page.GotoAsync("https://playwright.dev/dotnet");
                await page.ScreenshotAsync(new PageScreenshotOptions { Path = "screenshot.png" });
                await browser.DisposeAsync();
            }
        }
    }
}

When I tried the same steps except using .NET Core 3.1 everything worked fine.

Relevant log output

If I try to run playwright install (for the 4.8 project) in the Package Manager Console, I get...

PM> playwright install
playwright : Unhandled exception. System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, 
Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'. The system cannot find the file specified.
At line:1 char:1
+ playwright install
+ ~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotSpecified: (Unhandled excep...file specified.:String) [], RemoteException
    + FullyQualifiedErrorId : NativeCommandError
 
File name: 'Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'
   at System.Reflection.RuntimeAssembly.GetExportedTypes()
   at Microsoft.Playwright.CLI.Program.Main(String[] args) in /_/src/Playwright.CLI/Program.cs:line 75

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
pavelfeldmancommented, Oct 4, 2021

Things should work on latest Playwright.

1reaction
avodovnikcommented, Aug 23, 2021

Thanks for the tip @atiris . I tried this and got a different result running the program, Playwright threw Microsoft.Playwright.PlaywrightException: ‘Process exited’ as soon as it hit using (var playwright = await Playwright.CreateAsync()) .

That would usually imply a missing installation… did you run playwright install?

The 4.8 issue where .playwright isn’t copied correctly is definitely a bug. Working to fix it.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshoot blocked .NET Framework installations and ...
Troubleshoot issues you encounter that prevent installation of the .NET Framework. Consult status messages for information to resolve ...
Read more >
.Net 4.8 fails to install
The GM setup asks if I want to install GM, click Yes or No to continue. .Net 4.8 Error from Logs. OS Version...
Read more >
Installing .Net 4.8 Error Cannot Find Object or property. ...
Solution: if you look at the path provided and the file does exist then there is a good chance you already have .net...
Read more >
Cannot get .Net Framework 4.8 to install on Windows ...
I am currently running .Net Framework 4.7.03062 on my Windows 2012 Server. I ran the Offline installation of Version 4.8.
Read more >
Force Install .NET 4.8.1 on Server 2016
The reason .NET Framework 4.8.1 even support(s) the versions of Windows it supports, is because its built-into those versions, Windows Server ...
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