From 90e02cb69ca13c3ef8a11276015858e945a0acfa Mon Sep 17 00:00:00 2001 From: Dmitry Gozman Date: Thu, 4 Jun 2026 15:26:48 +0100 Subject: [PATCH] fix(build): avoid duplicate Content items (NETSDK1022) in targets CopyPlaywrightFilesToOutput could emit the same node\LICENSE as a Content item more than once, tripping the NETSDK1022 "Duplicate Content items" check (a hard error as of .NET 10). Make the platform-specific globs and the fallback wildcard mutually exclusive via an explicit per-platform check, exclude LICENSE from the fallback wildcard, and declare the platform-independent LICENSE/package items in their own non-batched ItemGroup so they are added exactly once. Fixes https://github.com/microsoft/playwright-dotnet/issues/3314 --- src/Playwright/build/Microsoft.Playwright.targets | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/Playwright/build/Microsoft.Playwright.targets b/src/Playwright/build/Microsoft.Playwright.targets index 378b76c46b..4d03f6d96c 100644 --- a/src/Playwright/build/Microsoft.Playwright.targets +++ b/src/Playwright/build/Microsoft.Playwright.targets @@ -13,6 +13,10 @@ <_PlaywrightPlatforms Include="$(PlaywrightPlatform)" /> + + + <_PlaywrightCopyItems Include="$(MSBuildThisFileDirectory)..\.playwright\node\linux-x64\**" Condition="'%(_PlaywrightPlatforms.Identity)' == 'linux' OR '%(_PlaywrightPlatforms.Identity)' == 'linux-x64'"> node\linux-x64\ @@ -30,9 +34,15 @@ <_PlaywrightCopyItems Include="$(MSBuildThisFileDirectory)..\.playwright\node\win32_x64\**" Condition="'%(_PlaywrightPlatforms.Identity)' == 'win' OR '%(_PlaywrightPlatforms.Identity)' == 'win-x64'"> node\win32_x64\ - <_PlaywrightCopyItems Include="$(MSBuildThisFileDirectory)..\.playwright\node\**" Condition="'@(_PlaywrightCopyItems->Count())' == '0'"> + + <_PlaywrightCopyItems Include="$(MSBuildThisFileDirectory)..\.playwright\node\**" Exclude="$(MSBuildThisFileDirectory)..\.playwright\node\LICENSE" Condition="'%(_PlaywrightPlatforms.Identity)' != 'linux' AND '%(_PlaywrightPlatforms.Identity)' != 'linux-x64' AND '%(_PlaywrightPlatforms.Identity)' != 'linux-arm64' AND '%(_PlaywrightPlatforms.Identity)' != 'osx' AND '%(_PlaywrightPlatforms.Identity)' != 'osx-x64' AND '%(_PlaywrightPlatforms.Identity)' != 'osx-arm64' AND '%(_PlaywrightPlatforms.Identity)' != 'win' AND '%(_PlaywrightPlatforms.Identity)' != 'win-x64'"> node\ + + + <_PlaywrightCopyItems Include="$(MSBuildThisFileDirectory)..\.playwright\node\LICENSE"> node\