You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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">.
The text was updated successfully, but these errors were encountered:
I helped Pavan with analyzing this issue to come up with a fix.
One important condition in our build process is that we essentially do:
dotnet restore
dotnet build --no-restore
Sign dlls using a build task outside of MSBuild
dotnet publish -f net48 --no-restore --no-build
dotnet publish -f net6.0 --no-restore --no-build
It's during the 'publish' with --no-build that this situation occurs.
Whenever dynamically adding Content/None items to a project, I've found that the safest time to do it is before the AssignTargetPaths target executes. This target is a dependency of Build, Publish and Pack targets.
Context
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 subsequentpublish
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
theCopyPlaywrightFilesToOutput
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">
.The text was updated successfully, but these errors were encountered: