|
2 | 2 | <PropertyGroup>
|
3 | 3 | <_MicrosoftNetSdkWindowsDesktop>true</_MicrosoftNetSdkWindowsDesktop>
|
4 | 4 | </PropertyGroup>
|
5 |
| - |
6 |
| - <ItemGroup Condition=" '$(EnableDefaultItems)' == 'true' And '$(UseWPF)' == 'true'"> |
| 5 | + |
| 6 | + <ItemGroup Condition=" '$(EnableDefaultItems)' == 'true' And '$(UseWPF)' == 'true' And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0')"> |
7 | 7 | <ApplicationDefinition Include="App.xaml"
|
8 | 8 | Condition="'$(EnableDefaultApplicationDefinition)' != 'false' And Exists('$(MSBuildProjectDirectory)/App.xaml') And '$(MSBuildProjectExtension)' == '.csproj'">
|
9 | 9 | <Generator>MSBuild:Compile</Generator>
|
|
13 | 13 | <Generator>MSBuild:Compile</Generator>
|
14 | 14 | </ApplicationDefinition>
|
15 | 15 |
|
16 |
| - <None Remove="@(ApplicationDefinition)" |
17 |
| - Condition="'$(EnableDefaultApplicationDefinition)' != 'false'" /> |
18 |
| - |
19 | 16 | <Page Include="**/*.xaml"
|
20 | 17 | Exclude="$(DefaultItemExcludes);$(DefaultExcludesInProjectFolder);@(ApplicationDefinition)"
|
21 | 18 | Condition="'$(EnableDefaultPageItems)' != 'false'" >
|
22 | 19 | <Generator>MSBuild:Compile</Generator>
|
23 | 20 | </Page>
|
24 | 21 |
|
25 |
| - <None Remove="@(Page)" |
26 |
| - Condition="'$(EnableDefaultPageItems)' != 'false'" /> |
| 22 | + |
| 23 | + <!-- |
| 24 | + See https://github.com/dotnet/wpf/issues/685 |
| 25 | + Visual Studio would prefer that we remove **/*.xaml instead of |
| 26 | + being more precise. |
| 27 | +
|
| 28 | + <None Remove="@(Page)" |
| 29 | + Condition="'$(EnableDefaultPageItems)' != 'false'" /> |
| 30 | + <None Remove="@(ApplicationDefinition)" |
| 31 | + Condition="'$(EnableDefaultApplicationDefinition)' != 'false'" /> |
| 32 | + --> |
| 33 | + <None Remove="**/*.xaml" |
| 34 | + Condition="'$(EnableDefaultApplicationDefinition)' != 'false' And '$(EnableDefaultPageItems)' != 'false'" /> |
27 | 35 | </ItemGroup>
|
28 | 36 |
|
29 |
| - <ItemGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(UseWPF)' == 'true' And '$(UseWindowsForms)' == 'true'"> |
| 37 | + <ItemGroup Condition="('$(DisableImplicitFrameworkReferences)' != 'true') And ('$(UseWPF)' == 'true') And ('$(UseWindowsForms)' == 'true') And ('$(TargetFrameworkIdentifier)' == '.NETCoreApp') And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0')"> |
30 | 38 | <FrameworkReference Include="Microsoft.WindowsDesktop.App" IsImplicitlyDefined="true" />
|
31 | 39 | </ItemGroup>
|
32 | 40 |
|
33 |
| - <ItemGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(UseWPF)' == 'true' And '$(UseWindowsForms)' != 'true'"> |
| 41 | + <ItemGroup Condition="('$(DisableImplicitFrameworkReferences)' != 'true') And ('$(UseWPF)' == 'true') And ('$(UseWindowsForms)' != 'true') And ('$(TargetFrameworkIdentifier)' == '.NETCoreApp') And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0')"> |
34 | 42 | <FrameworkReference Include="Microsoft.WindowsDesktop.App.WPF" IsImplicitlyDefined="true" />
|
35 | 43 | </ItemGroup>
|
36 | 44 |
|
37 |
| - <ItemGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true' And '$(TargetFrameworkIdentifier)' == '.NETCoreApp' And '$(UseWPF)' != 'true' And '$(UseWindowsForms)' == 'true'"> |
| 45 | + <ItemGroup Condition="('$(DisableImplicitFrameworkReferences)' != 'true') And ('$(UseWPF)' != 'true') And ('$(UseWindowsForms)' == 'true') And ('$(TargetFrameworkIdentifier)' == '.NETCoreApp') And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0')"> |
38 | 46 | <FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" IsImplicitlyDefined="true" />
|
39 | 47 | </ItemGroup>
|
40 | 48 |
|
|
63 | 71 | the private $(_TargetFrameworkVersionWithoutV) property - which will likely remain supported and
|
64 | 72 | is safe to use here.
|
65 | 73 | -->
|
66 |
| - <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' And '$(_TargetFrameworkVersionWithoutV)' != ''"> |
| 74 | + <ItemGroup Condition="('$(TargetFrameworkIdentifier)' == '.NETFramework') And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0')"> |
67 | 75 | <_WpfCommonNetFxReference Include="WindowsBase" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'" />
|
68 | 76 | <_WpfCommonNetFxReference Include="PresentationCore" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'" />
|
69 | 77 | <_WpfCommonNetFxReference Include="PresentationFramework" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '3.0'" />
|
|
79 | 87 | <_WpfCommonNetFxReference Include="System.Windows.Controls.Ribbon" Condition="'$(_TargetFrameworkVersionWithoutV)' >= '4.5'" />
|
80 | 88 | </ItemGroup>
|
81 | 89 |
|
82 |
| - <ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework' And '$(UseWPF)' == 'true' "> |
| 90 | + <ItemGroup Condition=" ('$(DisableImplicitFrameworkReferences)' != 'true') And ('$(TargetFrameworkIdentifier)' == '.NETFramework') And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0') And ('$(UseWPF)' == 'true') "> |
83 | 91 | <_SDKImplicitReference Include="@(_WpfCommonNetFxReference)" />
|
84 | 92 | </ItemGroup>
|
85 | 93 |
|
86 |
| - <ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework' And '$(UseWindowsForms)' == 'true' "> |
| 94 | + <ItemGroup Condition=" ('$(DisableImplicitFrameworkReferences)' != 'true') And ('$(TargetFrameworkIdentifier)' == '.NETFramework') And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0') And ('$(UseWindowsForms)' == 'true') "> |
87 | 95 | <_SDKImplicitReference Include="System.Windows.Forms"/>
|
88 | 96 | </ItemGroup>
|
89 | 97 |
|
90 |
| - <ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework' And '$(UseWindowsForms)' == 'true' And '$(UseWPF)' == 'true' "> |
| 98 | + <ItemGroup Condition=" ('$(DisableImplicitFrameworkReferences)' != 'true') And ('$(TargetFrameworkIdentifier)' == '.NETFramework') And ('$(_TargetFrameworkVersionWithoutV)' != '') And ('$(_TargetFrameworkVersionWithoutV)' >= '3.0') And ('$(UseWindowsForms)' == 'true') And ('$(UseWPF)' == 'true') "> |
91 | 99 | <_SDKImplicitReference Include="WindowsFormsIntegration"/>
|
92 | 100 | </ItemGroup>
|
93 | 101 | </Project>
|
0 commit comments