Skip to content

Commit 7fae1c0

Browse files
committed
Fix conditional PackageReference being ignored VS by moving into dedicated files.
1 parent 8b58455 commit 7fae1c0

File tree

4 files changed

+41
-7
lines changed

4 files changed

+41
-7
lines changed
+2-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,4 @@
11
<Project>
2-
<ItemGroup>
3-
<PackageReference Condition="'$(HasWinUI)' == 'true'" Include="Microsoft.UI.Xaml" Version="2.8.7-prerelease.241119001" />
4-
<PackageReference Condition="'$(MultiTargetPlatformIdentifier)' == 'windows'" Include="Microsoft.Windows.CsWinRT" Version="2.1.6" PrivateAssets="all" />
5-
6-
<!-- Temp workaround until next Windows SDK servicing update -->
7-
<PackageReference Condition="'$(HasWinUI)' == 'true' AND '$(MultiTargetPlatformIdentifier)' == 'windows' AND '$(IsDeployableHead)' != 'true'" Include="Microsoft.Windows.SDK.CPP" Version="10.0.26100.2454" PrivateAssets="all" />
8-
</ItemGroup>
2+
<!-- The inner imports in these props are conditional, and must be in a <When> statement in their own file to work in Visual Studio. https://stackoverflow.com/a/16557059 -->
3+
<Import Project="$(MSBuildThisFileDirectory)/Uwp/*.props" />
94
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<!-- Condition must be on a <When> statement in its own file for this to work in Visual Studio. https://stackoverflow.com/a/16557059 -->
3+
<Choose>
4+
<!-- Temp workaround until next Windows SDK servicing update -->
5+
<When Condition="'$(HasWinUI)' == 'true'" >
6+
<ItemGroup>
7+
<PackageReference Include="Microsoft.UI.Xaml" Version="2.8.7-prerelease.241119001" />
8+
</ItemGroup>
9+
</When>
10+
<Otherwise>
11+
</Otherwise>
12+
</Choose>
13+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<!-- Condition must be on a <When> statement in its own file for this to work in Visual Studio. https://stackoverflow.com/a/16557059 -->
3+
<Choose>
4+
<!-- Temp workaround until next Windows SDK servicing update -->
5+
<When Condition="'$(MultiTargetPlatformIdentifier)' == 'windows'" >
6+
<ItemGroup>
7+
<PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.6" PrivateAssets="all" />
8+
</ItemGroup>
9+
</When>
10+
<Otherwise>
11+
</Otherwise>
12+
</Choose>
13+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<Project>
2+
<!-- Condition must be on a <When> statement in its own file for this to work in Visual Studio. https://stackoverflow.com/a/16557059 -->
3+
<Choose>
4+
<!-- Temp workaround until next Windows SDK servicing update -->
5+
<When Condition="'$(HasWinUI)' == 'true'" >
6+
<ItemGroup>
7+
<PackageReference Include="Microsoft.Windows.SDK.CPP" Version="10.0.26100.2454" PrivateAssets="all" />
8+
</ItemGroup>
9+
</When>
10+
<Otherwise>
11+
</Otherwise>
12+
</Choose>
13+
</Project>

0 commit comments

Comments
 (0)