Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Playwright does not work with packages.config (.NET 4.8) #2004

Closed
Jojoshua opened this issue Feb 10, 2022 · 5 comments · Fixed by #2266
Closed

[BUG] Playwright does not work with packages.config (.NET 4.8) #2004

Jojoshua opened this issue Feb 10, 2022 · 5 comments · Fixed by #2266

Comments

@Jojoshua
Copy link

Context:

  • Playwright Version: 1.18.1
  • Operating System: Win 10
  • .NET version: 4.8
  • Browser: N/A

Code Snippet

 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();
            }
        }

Describe the bug
Driver is not found upon load. Clone this project for complete reproduction

https://github.com/Jojoshua/Playwright4.8InstallIssue

@mxschmitt mxschmitt changed the title [BUG] Setup will not work with .NET 4.8 (2) [BUG] Playwright does not work with packages.config (.NET 4.8) Feb 11, 2022
@mxschmitt
Copy link
Member

I'd recommend to migrate to PackageReference, then it should work as expected: https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference

@Jojoshua
Copy link
Author

I'd recommend to migrate to PackageReference, then it should work as expected: https://docs.microsoft.com/en-us/nuget/consume-packages/migrate-packages-config-to-package-reference

This worked for my plain console app but it did not work for my asp.net project. When I tried to convert it to package references an error said my project was not eligible for upgrading.

@campersau
Copy link
Contributor

@Jojoshua
Copy link
Author

@Jojoshua These resources might help you with the migration: NuGet/docs.microsoft.com-nuget#860 (comment) https://stackoverflow.com/questions/57581514/vs-2015-to-2017-migrate-to-package-reference-failed/65701746

Looks like NuGet/Home#5877 is still not completely implemented...

Thanks I will check that out and see if it works. My preference would be to migrate but it looks flaky for rebuilds.

However migration aside, does playwright-dotnet not intend to support existing projects using packages.config?

@Jojoshua
Copy link
Author

Jojoshua commented Apr 5, 2022

There are a slew of net 4.8 issues related to getting started and path drivers. This has been a blocker moving from puppeteer. Can we get a round of 4.8 fixes please?

BeniFreitag added a commit to BeniFreitag/playwright-dotnet that referenced this issue Aug 8, 2022
Extended Playwright.CreateAsync() with optional driversPath param

Fixes microsoft#1842, fixes microsoft#2240, fixes microsoft#2004
BeniFreitag added a commit to BeniFreitag/playwright-dotnet that referenced this issue Aug 8, 2022
Extended Playwright.CreateAsync() with optional driversPath param

Fixes microsoft#1842, fixes microsoft#2240, fixes microsoft#2004
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants