playwright-dotnet: [Question]: "Microsoft.Playwright assembly was found, but is missing required assets." - showing while trying to download browser binaries.
Your question
Trying to download browser binaries using playwright.ps1 install , but it shows Microsoft.Playwright assembly was found, but is missing required assets. Please ensure to build your project before running Playwright tool. Even after building my dotnet project the result is same as this.
Any kind of help will be apricated, thanks.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 20 (4 by maintainers)
As @gaelj mentioned, adding this to the .csproj file that references playwright will do the trick:
I was building on Windows, copying files in a docker build and attempting to run
pwsh playwright.ps1 install chromiumon Linux and getting the error reported by the OP.Adding
<PlaywrightPlatform>all</PlaywrightPlatform>solved it.@evilprince2009 Seem like you are running on MacOS. Not sure if this helps
bin/debug/net6.0/.playwright/nodefolder. Note that .playwright is hidden folder.If the folder is NOT mac, then try to delete your folder and run these command on Mac terminal.
dotnet publish --configuration Release -r osx-x64 --output temp-release-foldercd temp-release-folderpwsh .\playwright.ps1 installHope it helps. Cheers
This helped me. Thank you! I lost 6 hours searching for this solution.
This has also solved the problem for me - it appears to have been introduced in 1.33.0, 1.32 and below were all fine without this entry.
@igor-svirid we run the following two commands prior to running the tests (we only test with Chrome):
Hope this helps.
If it can help, I had the same problem because the
PlaywrightPlatformin thecsprojwas wrong. Fixed it by setting it toallAccording to the documentation use
pwsh bin/Debug/netX/playwright.ps1 installinstead. See https://playwright.dev/dotnet/docs/intro