-
Notifications
You must be signed in to change notification settings - Fork 230
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
Paths.GetExecutablePath fails in .NET 6 single-file executables #1527
Comments
Thanks for brining this up! Since .NET 6 is still a preview, it's not a scenario we looked at yet. It sounds like it might require a completely different approach to packaging the drivers, though. That said, PR #1520 might provide a reasonably sufficient workaround. I've added an additional guard to the location check though. |
I have the same issue when using the
Both v1.12.2 and v1.13.0-next-1 throws |
@eddietisma I suspect the problem is that we reset the location of the assembly, if we can't find As a workaround, though, you can place a file and call it |
Closing as part of the triage process since it seemed stale or did not get enough upvotes in the past. Please create a new issue with a detailed reproducible or feature request if you still face issues. |
In .NET 6 single-file applications, Assembly.Location is documented to return an empty string. This causes the
Microsoft.Playwright.Helpers.Paths.GetExecutablePath()
method called byPlaywright.CreateAsyn()
to fail with the following exception:The method is trying to identify Playwright's path by checking the library's location. In this case though,
Assembly.Location
will be empty:In this case, the
playwright.ps1
script will also fail because it tries to load the Playwright assembly explicitly:playwright-dotnet/src/Playwright/Helpers/Paths.cs
Line 37 in 1b18e16
The text was updated successfully, but these errors were encountered: