Skip to content

Commit ea70eed

Browse files
Ensure that implicit references for .NET Framework projects are appropriate when targeting net3x and net40
Fixes #255
1 parent 07f4b00 commit ea70eed

File tree

1 file changed

+27
-2
lines changed

1 file changed

+27
-2
lines changed

packaging/Microsoft.NET.Sdk.WindowsDesktop/targets/Microsoft.NET.Sdk.WindowsDesktop.props

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,16 +34,41 @@
3434
<FrameworkReference Include="Microsoft.WindowsDesktop.App.WindowsForms" IsImplicitlyDefined="true" />
3535
</ItemGroup>
3636

37+
<!--
38+
Traditionally, Visual Studio has supplied these references for .NET Framework based
39+
WPF Projects:
40+
41+
.NET 3.x: PresentationCore, PresentationFramework, WindowsBase
42+
.NET 4.x: PresentationCore, PresentationFramework, WindowsBase, System.Xaml
43+
44+
45+
Microsoft.NET.WindowsDesktop.SDK will supply the following references to .NET Framework based
46+
WPF Projects:
47+
48+
.NET 3.x: PresentationCore, PresentationFramework, WindowsBase
49+
50+
.NET 4.0: PresentationCore, PresentationFramework, WindowsBase, System.Xaml,
51+
UIAutomationClient, UIAutomationClientSideProviders, UIAutomationProvider, UIAutomationTypes
52+
53+
.NET 4.5+: PresentationCore, PresentationFramework, WindowsBase, System.Xaml,
54+
UIAutomationClient, UIAutomationClientSideProviders, UIAutomationProvider, UIAutomationTypes
55+
System.Windows.Controls.Ribbon
56+
-->
3757
<ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework' And '$(UseWPF)' == 'true' ">
3858
<_SDKImplicitReference Include="WindowsBase"/>
3959
<_SDKImplicitReference Include="PresentationCore"/>
4060
<_SDKImplicitReference Include="PresentationFramework"/>
41-
<_SDKImplicitReference Include="System.Windows.Controls.Ribbon"/>
42-
<_SDKImplicitReference Include="System.Xaml"/>
61+
</ItemGroup>
62+
63+
<ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework' And '$(UseWPF)' == 'true' And $(TargetFramework.StartsWith('net4'))">
64+
<_SDKImplicitReference Include="System.Xaml">
65+
<RequiredTargetFramework>4.0</RequiredTargetFramework>
66+
</_SDKImplicitReference>
4367
<_SDKImplicitReference Include="UIAutomationClient"/>
4468
<_SDKImplicitReference Include="UIAutomationClientSideProviders"/>
4569
<_SDKImplicitReference Include="UIAutomationProvider"/>
4670
<_SDKImplicitReference Include="UIAutomationTypes"/>
71+
<_SDKImplicitReference Condition="'$(TargetFramework)' != 'net40'" Include="System.Windows.Controls.Ribbon"/>
4772
</ItemGroup>
4873

4974
<ItemGroup Condition=" '$(DisableImplicitFrameworkReferences)' != 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework' And '$(UseWindowsForms)' == 'true' ">

0 commit comments

Comments
 (0)