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)

Most upvoted comments

As @gaelj mentioned, adding this to the .csproj file that references playwright will do the trick:

<PropertyGroup>
  <PlaywrightPlatform>all</PlaywrightPlatform>
</PropertyGroup>

I was building on Windows, copying files in a docker build and attempting to run pwsh playwright.ps1 install chromium on 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

  • Go to bin/debug/net6.0/.playwright/node folder. Note that .playwright is hidden folder.
  • Make sure that under node, you will see folder called: “mac”. Not “win32_x64” or “linux-x64”.

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-folder cd temp-release-folder pwsh .\playwright.ps1 install

Hope it helps. Cheers

As @gaelj mentioned, adding this to the .csproj file that references playwright will do the trick:

<PropertyGroup>
  <PlaywrightPlatform>all</PlaywrightPlatform>
</PropertyGroup>

I was building on Windows, copying files in a docker build and attempting to run pwsh playwright.ps1 install chromium on Linux and getting the error reported by the OP.

Adding <PlaywrightPlatform>all</PlaywrightPlatform> solved it.

This helped me. Thank you! I lost 6 hours searching for this solution.

As @gaelj mentioned, adding this to the .csproj file that references playwright will do the trick:

<PropertyGroup>
  <PlaywrightPlatform>all</PlaywrightPlatform>
</PropertyGroup>

I was building on Windows, copying files in a docker build and attempting to run pwsh playwright.ps1 install chromium on Linux and getting the error reported by the OP. Adding <PlaywrightPlatform>all</PlaywrightPlatform> solved it.

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):

playwright.ps1 install chromium
playwright.ps1 install-deps chromium

Hope this helps.

If it can help, I had the same problem because the PlaywrightPlatform in the csproj was wrong. Fixed it by setting it to all

According to the documentation use pwsh bin/Debug/netX/playwright.ps1 install instead. See https://playwright.dev/dotnet/docs/intro