microsoft / microsoft/playwright-dotnet
[BUG] Publish target on a consuming project does not include assets in .playwright folder
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 3k
- Forks
- 305
- Avg merge
- 20h 47m
- Merged PRs (30d)
- 6
Description
Context
- Playwright Version: 1.22.0
- Operating System: Cross-Platform
- .NET version: .NET 4.8, .NET 6
- Browser: N/A
Description
We've observed that when we consume the Playwright NuGet package in our project and build it, the included assets in the .playwright folder are copied over to the build output. However in a subsequent publish step, the playwright DLLs are included but the assets in the .playwright folder are missed out. This is leading to our final application distributable package missing these assets and therefore breaking functionality.
We believe this is happening because in Microsoft.Playwright.targets the CopyPlaywrightFilesToOutput target has been set to execute before a build step (i.e. AfterTargets="BeforeBuild"), and hence this target does not execute during publish. In our internal tests, setting this target to execute at a different point seems to help i.e. executes at the publish step as well. Our test - <Target Name="CopyPlaywrightFilesToOutput" AfterTargets="AssignTargetPaths">.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with Microsoft.Playwright.targets and inspect the CopyPlaywrightFilesToOutput target, especially its current AfterTargets setting and how publish invokes the build targets. Reproduce the build and publish flow for a consuming .NET project, then verify that assets under .playwright are present in the final published output without breaking existing output behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- build-system, release
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100