Skip to content

Commit 1f63a8b

Browse files
authored
Remove redundant items in .targets (#1687)
* Remove redundant items in .targets * Remove leftover feature switch * Remove 'CompilerVisibleProperty' * Fix 'AuthoringWuxTest.csproj'
1 parent d4c8461 commit 1f63a8b

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

nuget/Microsoft.Windows.CsWinRT.Authoring.targets

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Copyright (C) Microsoft Corporation. All rights reserved.
3333
<CompilerVisibleProperty Include="CsWinRTWindowsMetadata" />
3434
<CompilerVisibleProperty Include="CsWinRTGenerateProjection" />
3535
<CompilerVisibleProperty Include="CsWinRTAuthoringInputs" />
36-
<CompilerVisibleProperty Include="CsWinRTUseWindowsUIXamlProjections" />
3736
</ItemGroup>
3837

3938
<!-- Note this runs before the msbuild editor config file is generated because that is what is used to pass properties to the source generator. -->

nuget/Microsoft.Windows.CsWinRT.targets

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -309,13 +309,6 @@ $(CsWinRTInternalProjection)
309309
</ItemGroup>
310310
</Target>
311311

312-
<ItemGroup>
313-
<RuntimeHostConfigurationOption Include="CsWinRT.UiXamlMode" Condition="'$(CsWinRTUiXamlMode)' != ''">
314-
<Value>$(CsWinRTUiXamlMode)</Value>
315-
<Trim>true</Trim>
316-
</RuntimeHostConfigurationOption>
317-
</ItemGroup>
318-
319312
<Import Project="$(MSBuildThisFileDirectory)Microsoft.Windows.CsWinRT.Prerelease.targets" Condition="Exists('$(MSBuildThisFileDirectory)Microsoft.Windows.CsWinRT.Prerelease.targets')"/>
320313
<Import Project="$(MSBuildThisFileDirectory)Microsoft.Windows.CsWinRT.Authoring.targets" Condition="'$(CsWinRTComponent)' == 'true'"/>
321314
<Import Project="$(MSBuildThisFileDirectory)Microsoft.Windows.CsWinRT.IIDOptimizer.targets" Condition="'$(CsWinRTIIDOptimizerOptOut)' != 'true'"/>
@@ -328,7 +321,11 @@ $(CsWinRTInternalProjection)
328321
<CsWinRTEnableICustomPropertyProviderSupport Condition="'$(CsWinRTEnableICustomPropertyProviderSupport)' == ''">true</CsWinRTEnableICustomPropertyProviderSupport>
329322
<CsWinRTEnableIReferenceSupport Condition="'$(CsWinRTEnableIReferenceSupport)' == ''">true</CsWinRTEnableIReferenceSupport>
330323
<CsWinRTEnableIDynamicInterfaceCastableSupport Condition="'$(CsWinRTEnableIDynamicInterfaceCastableSupport)' == ''">true</CsWinRTEnableIDynamicInterfaceCastableSupport>
331-
<CsWinRTUseWindowsUIXamlProjections Condition="'$(CsWinRTUseWindowsUIXamlProjections)' == ''">false</CsWinRTUseWindowsUIXamlProjections>
324+
325+
<!--
326+
Note: the 'CsWinRTUseWindowsUIXamlProjections' property and associated 'CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS' feature
327+
switch are set by the .NET SDK, so that the right projection mode is enabled even when CsWinRT is not directly referenced.
328+
-->
332329
</PropertyGroup>
333330

334331
<!-- Default values for all other CsWinRT properties (without feature switches) -->
@@ -371,11 +368,6 @@ $(CsWinRTInternalProjection)
371368
<RuntimeHostConfigurationOption Include="CSWINRT_ENABLE_IDYNAMICINTERFACECASTABLE"
372369
Value="$(CsWinRTEnableIDynamicInterfaceCastableSupport)"
373370
Trim="true" />
374-
375-
<!-- CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS switch -->
376-
<RuntimeHostConfigurationOption Include="CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS"
377-
Value="$(CsWinRTUseWindowsUIXamlProjections)"
378-
Trim="true" />
379371
</ItemGroup>
380372

381373
</Project>

src/Tests/AuthoringWuxTest/AuthoringWuxTest.csproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,14 @@
1111
<!-- <CsWinRTEnableLogging>true</CsWinRTEnableLogging> -->
1212
<!--<CsWinRTKeepGeneratedSources>true</CsWinRTKeepGeneratedSources>-->
1313
</PropertyGroup>
14+
15+
<!-- Temporary workaround, remove when https://github.com/dotnet/sdk/pull/41936 is available in the .NET SDK -->
16+
<ItemGroup>
17+
<CompilerVisibleProperty Include="CsWinRTUseWindowsUIXamlProjections" />
18+
<RuntimeHostConfigurationOption Include="CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS"
19+
Value="$(CsWinRTUseWindowsUIXamlProjections)"
20+
Trim="true" />
21+
</ItemGroup>
1422

1523
<ItemGroup>
1624
<ProjectReference Include="..\..\Projections\Windows\Windows.csproj" />

0 commit comments

Comments
 (0)