Skip to content

Microsoft.NET.Sdk.WindowsDesktop.props references System.Windows.Controls.Ribbon on .NET 4.0 #255

Closed

Description

@ericstj

Problem description:
When targeting net40 from a WPF app the build emits a warning.

Actual behavior:
Warning:

C:\Program Files\dotnet\sdk\3.0.100-preview-010046\Microsoft.Common.CurrentVersion.targets(2114,5): warning MSB3267: The primary reference "System.Windows.Controls.Ribbon", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Windows.Controls.Ribbon" or retarget your application to a framework version which contains "System.Windows.Controls.Ribbon".

Expected behavior:
No warning

Minimal repro:
dotnet new wpf
change targetframework to net40 or make it cross-target.
dotnet build

(project also attached)
net40.zip

I believe the fix is here is to put a condition on the _SDKImplicitReference items defined in Microsoft.NET.Sdk.WindowsDesktop.props.

Originally reported here: dotnet/core#2085 (comment)

Activity

  1. virzak commented on Jan 13, 2019

    @virzak

    Same issue with net35

  2. added this to the 3.0 milestone on Apr 4, 2019
  3. added
    Enhancement Requested
    on Apr 4, 2019
  4. billhenn commented on May 9, 2019

    @billhenn

    We are beginning to multi-target our WPF control assemblies to net40 and netcoreapp3.0 and are running into this warning now all over the place:

    MSB3267 The primary reference "System.Windows.Controls.Ribbon", which is a framework assembly, could not be resolved in the currently targeted framework. ".NETFramework,Version=v4.0". To resolve this problem, either remove the reference "System.Windows.Controls.Ribbon" or retarget your application to a framework version which contains "System.Windows.Controls.Ribbon".

    This was originally reported in January and is still occurring in .NET 3.0 preview5. Will it be fixed soon?

  5. added
    Bug
    and removed
    Enhancement Requested
    on May 9, 2019
  6. vatsan-madhavan commented on May 9, 2019

    @vatsan-madhavan
    Member

    We should definitely fix this before p7. I worry that this will continue to be a big problem for several mainstream scenarios. This is either related to or a duplicate of #327.

    /cc @nguerrera, @grubioe, @rladuca

  7. modified the milestones: 3.0, Preview on May 9, 2019
  8. added 2 commits that reference this issue on Jun 5, 2019
    ea70eed
    c7a7478
  9. added a commit that references this issue on Jun 8, 2019
    7129d5a
  10. ghost locked as resolved and limited conversation to collaborators on Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Bugarea-infrastructure

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions