Skip to content

Commit 4c6acb4

Browse files
anuagragithAnukrati AgrawalCopilot
authored
Fix/playground composition build (#16199)
* Fix playground-composition build failures - Add missing 'Global' line to playground-composition.sln that caused autolink to corrupt the solution file (MSB5010) - Update SampleCustomComponent path to node_modules and remove ProjectSection to prevent autolink from adding duplicate entries (MSB5004) - Exclude @react-native-picker/picker from autolinking when targeting composition, as it is a UWP/Paper component incompatible with Win32/WinAppSDK (WindowsAppSDK transitive dependency error) - Use $(DefaultPlatformToolset) instead of hardcoded v143 in Playground-Composition.vcxproj and SampleCustomComponent.vcxproj for forward compatibility with newer VS versions Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Fix playground-composition parallel build and lock file issues - Align ProjectReference in Playground-Composition.vcxproj to use the same node_modules path as the .sln, preventing parallel build collisions when MSBuild resolves the same project via two different paths (C1041/FTK1011) - Add /FS flag to SampleCustomComponent for synchronized PDB writes - Disable RestoreLockedMode for playground-composition local dev builds to prevent NU1004 errors from stale lock files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Anukrati Agrawal <anuagra@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 2886581 commit 4c6acb4

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

packages/playground/react-native.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
const targetComposition = true;
44

55
module.exports = {
6+
dependencies: {
7+
// Picker is a UWP/Paper component not compatible with the composition playground
8+
...(targetComposition && {'@react-native-picker/picker': {platforms: {windows: null}}}),
9+
},
610
project: {
711
windows: {
812
sourceDir: 'windows',

packages/playground/windows/ExperimentalFeatures.props

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
<PropertyGroup Label="WinUI3 for fabric" Condition="'$(SolutionName)'=='playground-composition'">
1212
<RnwNewArch>true</RnwNewArch>
1313
<UseExperimentalNuget>false</UseExperimentalNuget>
14+
<!-- Disable locked restore for local dev; CI overrides via /p:RestoreLockedMode=true -->
15+
<RestoreLockedMode>false</RestoreLockedMode>
1416
</PropertyGroup>
1517

1618
</Project>

packages/playground/windows/playground-composition.sln

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,9 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Mso", "..\..\..\vnext\Mso\M
2828
EndProject
2929
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Include", "..\..\..\vnext\include\Include.vcxitems", "{EF074BA1-2D54-4D49-A28E-5E040B47CD2E}"
3030
EndProject
31-
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleCustomComponent", "..\..\sample-custom-component\windows\SampleCustomComponent\SampleCustomComponent.vcxproj", "{A8DA218C-4CB5-48CB-A9EE-9E6337165D07}"
32-
ProjectSection(ProjectDependencies) = postProject
33-
{F7D32BD0-2749-483E-9A0D-1635EF7E3136} = {F7D32BD0-2749-483E-9A0D-1635EF7E3136}
34-
EndProjectSection
31+
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "SampleCustomComponent", "..\..\..\node_modules\@rnw-scripts\sample-custom-component\windows\SampleCustomComponent\SampleCustomComponent.vcxproj", "{A8DA218C-4CB5-48CB-A9EE-9E6337165D07}"
3532
EndProject
33+
Global
3634
GlobalSection(SharedMSBuildProjectFiles) = preSolution
3735
..\..\..\vnext\Shared\Shared.vcxitems*{2049dbe9-8d13-42c9-ae4b-413ae38fffd0}*SharedItemsImports = 9
3836
..\..\..\vnext\Mso\Mso.vcxitems*{84e05bfa-cbaf-4f0d-bfb6-4ce85742a57e}*SharedItemsImports = 9

packages/playground/windows/playground-composition/Playground-Composition.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
<PropertyGroup Label="Configuration">
5555
<ConfigurationType>Application</ConfigurationType>
5656
<CharacterSet>Unicode</CharacterSet>
57-
<PlatformToolset>v143</PlatformToolset>
57+
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
5858
</PropertyGroup>
5959
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
6060
<UseDebugLibraries>true</UseDebugLibraries>
@@ -158,7 +158,7 @@
158158
<PackageReference Include="$(V8PackageName)" Version="$(V8Version)" Condition="'$(UseV8)' == 'true'" />
159159
</ItemGroup>
160160
<ItemGroup>
161-
<ProjectReference Include="..\..\..\sample-custom-component\windows\SampleCustomComponent\SampleCustomComponent.vcxproj">
161+
<ProjectReference Include="..\..\..\..\node_modules\@rnw-scripts\sample-custom-component\windows\SampleCustomComponent\SampleCustomComponent.vcxproj">
162162
<Project>{a8da218c-4cb5-48cb-a9ee-9e6337165d07}</Project>
163163
</ProjectReference>
164164
</ItemGroup>

packages/sample-custom-component/windows/SampleCustomComponent/SampleCustomComponent.vcxproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<PropertyGroup Label="Configuration">
4949
<ConfigurationType>DynamicLibrary</ConfigurationType>
5050
<CharacterSet>Unicode</CharacterSet>
51-
<PlatformToolset>v143</PlatformToolset>
51+
<PlatformToolset>$(DefaultPlatformToolset)</PlatformToolset>
5252
<GenerateManifest>false</GenerateManifest>
5353
</PropertyGroup>
5454
<PropertyGroup Condition="'$(Configuration)'=='Debug'" Label="Configuration">
@@ -76,7 +76,7 @@
7676
<PrecompiledHeaderOutputFile>$(IntDir)pch.pch</PrecompiledHeaderOutputFile>
7777
<WarningLevel>Level4</WarningLevel>
7878
<SDLCheck>true</SDLCheck>
79-
<AdditionalOptions>%(AdditionalOptions) /bigobj</AdditionalOptions>
79+
<AdditionalOptions>%(AdditionalOptions) /bigobj /FS</AdditionalOptions>
8080
<DisableSpecificWarnings>4453;28204</DisableSpecificWarnings>
8181
<PreprocessorDefinitions>_WINRT_DLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
8282
<AdditionalUsingDirectories>$(WindowsSDK_WindowsMetadata);$(AdditionalUsingDirectories)</AdditionalUsingDirectories>

0 commit comments

Comments
 (0)