|
1 | 1 | <Project>
|
2 | 2 | <PropertyGroup>
|
3 | 3 | <_MicrosoftNetSdkWindowsDesktop>true</_MicrosoftNetSdkWindowsDesktop>
|
4 |
| - |
5 |
| - <_InvalidTargetFrameworkVersion>0.0</_InvalidTargetFrameworkVersion> |
6 |
| - <_TargetFrameworkVersionValue Condition="'$(_TargetFrameworkVersionValue)' == ''">$([MSBuild]::ValueOrDefault($(_TargetFrameworkVersionWithoutV), $(_InvalidTargetFrameworkVersion)))</_TargetFrameworkVersionValue> |
7 |
| - |
| 4 | + |
8 | 5 | <EnableDefaultPageItems Condition="'$(EnableDefaultPageItems)' == ''">true</EnableDefaultPageItems>
|
9 | 6 | <EnableDefaultApplicationDefinition Condition="'$(EnableDefaultApplicationDefinition)' == ''">true</EnableDefaultApplicationDefinition>
|
10 | 7 | </PropertyGroup>
|
| 8 | + |
| 9 | + <PropertyGroup> |
| 10 | + <_InvalidTargetFrameworkVersion>0.0</_InvalidTargetFrameworkVersion> |
| 11 | + </PropertyGroup> |
| 12 | + |
| 13 | + <ItemGroup> |
| 14 | + <_WindowsDesktopTargetFrameworkVersion Remove="@(_WindowsDesktopTargetFrameworkVersion)" /> |
| 15 | + <_WindowsDesktopTargetFrameworkVersion Include="$([MSBuild]::ValueOrDefault($(_TargetFrameworkVersionWithoutV), $(_InvalidTargetFrameworkVersion)))" /> |
| 16 | + </ItemGroup> |
| 17 | + |
11 | 18 |
|
12 | 19 | <PropertyGroup>
|
13 | 20 | <!--
|
|
19 | 26 | using the SDK style projects. For e.g., see https://github.com/microsoft/msbuild/issues/1333
|
20 | 27 |
|
21 | 28 | Irrespective of whether '$(TargetFrameworkIdentifier)' is '.NETCoreApp' or '.NETFramework',
|
22 |
| - the minimum value of $(_TargetFrameworkVersionValue) we will be testing for is '3.0' |
| 29 | + the minimum value of @(_WindowsDesktopTargetFrameworkVersion) we will be testing for is '3.0' |
23 | 30 |
|
24 | 31 | Note:
|
25 | 32 | Please see https://github.com/microsoft/msbuild/issues/3212 for a discussion about the use of
|
26 | 33 | the private $(_TargetFrameworkVersionWithoutV) property - which will likely remain supported and
|
27 |
| - is safe to use here. This is used to in turn define $(_TargetFrameworkVersionValue). |
| 34 | + is safe to use here. This is used to in turn define @(_WindowsDesktopTargetFrameworkVersion). |
28 | 35 | -->
|
29 | 36 | <_WindowsDesktopSdkTargetFrameworkVersionFloor>3.0</_WindowsDesktopSdkTargetFrameworkVersionFloor>
|
30 | 37 | </PropertyGroup>
|
31 | 38 |
|
32 | 39 | <ItemGroup Condition=" ('$(EnableDefaultItems)' == 'true') And ('$(UseWPF)' == 'true') And
|
33 |
| - ('$(_TargetFrameworkVersionValue)' != '$(_InvalidTargetFrameworkVersion)') And |
34 |
| - ('$(_TargetFrameworkVersionValue)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
| 40 | + ('@(_WindowsDesktopTargetFrameworkVersion)' != '$(_InvalidTargetFrameworkVersion)') And |
| 41 | + ('@(_WindowsDesktopTargetFrameworkVersion)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
35 | 42 | <ApplicationDefinition Include="App.xaml"
|
36 | 43 | Condition="'$(EnableDefaultApplicationDefinition)' != 'false' And Exists('$(MSBuildProjectDirectory)/App.xaml') And '$(MSBuildProjectExtension)' == '.csproj'">
|
37 | 44 | <Generator>MSBuild:Compile</Generator>
|
|
65 | 72 |
|
66 | 73 | <ItemGroup Condition="('$(DisableImplicitFrameworkReferences)' != 'true') And
|
67 | 74 | ('$(TargetFrameworkIdentifier)' == '.NETCoreApp') And
|
68 |
| - ('$(_TargetFrameworkVersionValue)' != '$(_InvalidTargetFrameworkVersion)') And |
69 |
| - ('$(_TargetFrameworkVersionValue)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
| 75 | + ('@(_WindowsDesktopTargetFrameworkVersion)' != '$(_InvalidTargetFrameworkVersion)') And |
| 76 | + ('@(_WindowsDesktopTargetFrameworkVersion)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
70 | 77 |
|
71 | 78 | <FrameworkReference Include="Microsoft.WindowsDesktop.App" IsImplicitlyDefined="true"
|
72 | 79 | Condition="('$(UseWPF)' == 'true') And ('$(UseWindowsForms)' == 'true')"/>
|
|
101 | 108 |
|
102 | 109 | -->
|
103 | 110 | <ItemGroup Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') And
|
104 |
| - ('$(_TargetFrameworkVersionValue)' != '$(_InvalidTargetFrameworkVersion)') And |
105 |
| - ('$(_TargetFrameworkVersionValue)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
| 111 | + ('@(_WindowsDesktopTargetFrameworkVersion)' != '$(_InvalidTargetFrameworkVersion)') And |
| 112 | + ('@(_WindowsDesktopTargetFrameworkVersion)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
106 | 113 |
|
107 | 114 | <!--
|
108 |
| - The following 3 _WpfCommonNetFxReference items normally require Condition="'$(_TargetFrameworkVersionValue)' >= '3.0'", since |
| 115 | + The following 3 _WpfCommonNetFxReference items normally require Condition="'@(_WindowsDesktopTargetFrameworkVersion)' >= '3.0'", since |
109 | 116 | they are supported on .NET Framework 3.0 and above.
|
110 | 117 |
|
111 |
| - This condition is implicitly satisfied by '$(_TargetFrameworkVersionValue)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)' |
| 118 | + This condition is implicitly satisfied by '@(_WindowsDesktopTargetFrameworkVersion)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)' |
112 | 119 | in the outer ItemGroup
|
113 | 120 | -->
|
114 | 121 | <_WpfCommonNetFxReference Include="WindowsBase" />
|
115 | 122 | <_WpfCommonNetFxReference Include="PresentationCore" />
|
116 | 123 | <_WpfCommonNetFxReference Include="PresentationFramework" />
|
117 | 124 |
|
118 |
| - <_WpfCommonNetFxReference Include="System.Xaml" Condition="'$(_TargetFrameworkVersionValue)' >= '4.0'"> |
| 125 | + <_WpfCommonNetFxReference Include="System.Xaml" Condition="'@(_WindowsDesktopTargetFrameworkVersion)' >= '4.0'"> |
119 | 126 | <RequiredTargetFramework>4.0</RequiredTargetFramework>
|
120 | 127 | </_WpfCommonNetFxReference>
|
121 |
| - <_WpfCommonNetFxReference Include="UIAutomationClient" Condition="'$(_TargetFrameworkVersionValue)' >= '4.0'" /> |
122 |
| - <_WpfCommonNetFxReference Include="UIAutomationClientSideProviders" Condition="'$(_TargetFrameworkVersionValue)' >= '4.0'" /> |
123 |
| - <_WpfCommonNetFxReference Include="UIAutomationProvider" Condition="'$(_TargetFrameworkVersionValue)' >= '4.0'" /> |
124 |
| - <_WpfCommonNetFxReference Include="UIAutomationTypes" Condition="'$(_TargetFrameworkVersionValue)' >= '4.0'" /> |
| 128 | + <_WpfCommonNetFxReference Include="UIAutomationClient" Condition="'@(_WindowsDesktopTargetFrameworkVersion)' >= '4.0'" /> |
| 129 | + <_WpfCommonNetFxReference Include="UIAutomationClientSideProviders" Condition="'@(_WindowsDesktopTargetFrameworkVersion)' >= '4.0'" /> |
| 130 | + <_WpfCommonNetFxReference Include="UIAutomationProvider" Condition="'@(_WindowsDesktopTargetFrameworkVersion)' >= '4.0'" /> |
| 131 | + <_WpfCommonNetFxReference Include="UIAutomationTypes" Condition="'@(_WindowsDesktopTargetFrameworkVersion)' >= '4.0'" /> |
125 | 132 |
|
126 |
| - <_WpfCommonNetFxReference Include="System.Windows.Controls.Ribbon" Condition="'$(_TargetFrameworkVersionValue)' >= '4.5'" /> |
| 133 | + <_WpfCommonNetFxReference Include="System.Windows.Controls.Ribbon" Condition="'@(_WindowsDesktopTargetFrameworkVersion)' >= '4.5'" /> |
127 | 134 | </ItemGroup>
|
128 | 135 |
|
129 | 136 | <ItemGroup Condition="('$(DisableImplicitFrameworkReferences)' != 'true') And
|
130 | 137 | ('$(TargetFrameworkIdentifier)' == '.NETFramework') And
|
131 |
| - ('$(_TargetFrameworkVersionValue)' != '$(_InvalidTargetFrameworkVersion)') And |
132 |
| - ('$(_TargetFrameworkVersionValue)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
| 138 | + ('@(_WindowsDesktopTargetFrameworkVersion)' != '$(_InvalidTargetFrameworkVersion)') And |
| 139 | + ('@(_WindowsDesktopTargetFrameworkVersion)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
133 | 140 |
|
134 | 141 | <_SDKImplicitReference Include="@(_WpfCommonNetFxReference)"
|
135 | 142 | Condition="'$(UseWPF)' == 'true'"/>
|
|
161 | 168 | Detect these situations and skip updates to @(SupportedTargetFramework) etc.
|
162 | 169 | -->
|
163 | 170 | <ItemGroup Condition="('$(UseWPF)' == 'true' Or '$(UseWindowsForms)' == 'true') And
|
164 |
| - ('$(_TargetFrameworkVersionValue)' != '$(_InvalidTargetFrameworkVersion)') And |
165 |
| - ('$(_TargetFrameworkVersionValue)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
| 171 | + ('@(_WindowsDesktopTargetFrameworkVersion)' != '$(_InvalidTargetFrameworkVersion)') And |
| 172 | + ('@(_WindowsDesktopTargetFrameworkVersion)' >= '$(_WindowsDesktopSdkTargetFrameworkVersionFloor)')"> |
166 | 173 |
|
167 | 174 | <!--
|
168 | 175 | Windows Forms and WPF are supported only on .NET Core 3.0+
|
|
0 commit comments