Closed cleverchrismartinez closed 2 years ago
Yes, we are using published project (internal tool) on windows server which is using https://github.com/microsoft/playwright-dotnet.
Our steps that are integrated into our publish pipeline to accomplish that:
dotnet build "XYZ.sln" --configuration="Release" --framework="net5.0" --runtime="win-x64" --force
dotnet tool update --global Microsoft.Playwright.CLI
$env:PLAYWRIGHT_BROWSERS_PATH=0;Invoke-Expression "$env:USERPROFILE\.dotnet\tools\playwright.exe install"
dotnet publish "ABC.csproj" --output="<publish destination for project ABC>" --configuration="Release" --framework="net5.0" --runtime="win-x64" --self-contained="false"
Copy-Item -Path "<ABC project path>\bin\Release\net5.0\.playwright\package\.local-browsers" -Destination "<publish destination for project ABC>\.playwright\package" -Recurse
Sources:
I invoke the dotnet tool's cli directly when my program starts.
Microsoft.Playwright.Program.Main(new[] { "install" })
I invoke the dotnet tool's cli directly when my program starts.
Microsoft.Playwright.Program.Main(new[] { "install" })
That definitely seemed to work as far as getting it installed. My program still seems to think it should live in a different folder and refuses to acknowledge the installation, but that's a separate issue.
Thanks for your help!
I built a tool using Playwright dotnet, and it runs great locally. I'm trying to deploy it on my Windows server so other people can use it, and the problem is getting the headless browsers properly installed on the server.
If I do all of the quickstart tasks on https://playwright.dev/dotnet/docs/intro within Windows PowerShell out on the server, it goes fine until the
playwright install
step. At that point I get the following Error:Even if I try inputting the command
dotnet add package System.Runtime
it adds the package, but then when I tryplaywright install
again, it throws the same error.I even went so far as to try deploying the app anyway, and when I get to the part that requires Playwright, it says:
So I said screw it and installed Node on the server, then ran the npx command, and it says it installed the browsers, but I still get the same error telling me to run the npx command.
Has anyone had any luck getting Playwright installed and implemented on a Windows server?