Skip to content

Commit 13630f4

Browse files
committed
Enable 'cswinrtgen' when needed
1 parent 8068fe5 commit 13630f4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Tasks/Microsoft.NET.Build.Tasks/targets/Microsoft.NET.Windows.targets

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,9 @@ Copyright (c) .NET Foundation. All rights reserved.
174174
<!--
175175
Running 'cswinrtgen' is required for CsWinRT 3.0, and it is currently in preview.
176176
So the switch for it is currently opt-in. It can be changed to opt-out in the future.
177+
We only enable this automatically if the project is explicitly targeting CsWinRT 3.0.
177178
-->
179+
<CsWinRTGenerateInteropAssembly Condition="'$(CsWinRTGenerateInteropAssembly)' == '' and '$(_TargetPlatformVersionUsesCsWinRT3)' == 'true'">true</CsWinRTGenerateInteropAssembly>
178180
<CsWinRTGenerateInteropAssembly Condition="'$(CsWinRTGenerateInteropAssembly)' == ''">false</CsWinRTGenerateInteropAssembly>
179181

180182
<!-- Default property values for 'cswinrtgen' -->

0 commit comments

Comments
 (0)