Skip to content

Using a ProjectReference which requires AssetTargetFallback to succeed, should warn. #7137

Closed

Description

@nguerrera

Microsoft Visual Studio Enterprise 2017 Int Preview (Dogfood)
Version 15.8.0 Preview 5.0 [27913.3.d15.8]
VisualStudio.15.IntPreview/15.8.0-pre.5.0+27913.3.d15.8
Microsoft .NET Framework
Version 4.7.03056

Repro steps

  • Add project reference from .NET Core project to .NET Framework 4.6.1 project
  • Restore / Build

Expected

Very similar warning to this for the PackageReference case

Warning NU1701 Package 'XAct.Wintellect.PowerCollections 0.0.1' was restored using '.NETFramework,Version=v4.6.1' instead of the project target framework '.NETCoreApp,Version=v2.1'. This package may not be fully compatible with your project. ConsoleApp30 C:\Users\nicholg\source\repos\ConsoleApp30\ConsoleApp30\ConsoleApp30.csproj 1

Actual

No warning

This defeats the rationale for why it was deemed OK to make the net461 asset target fallback a default.

cc @rrelyea @mishra14 @rainersigwald @dsplaisted @terrajobst

Activity

  1. mishra14 commented on Jul 21, 2018

    @mishra14
    Contributor

    @nguerrera currently, msbuild passes us a project tfm and a set of tfms to check compatibility and we return a bool indicating success or failure. We will need to work with @rrainersigwald to change that if needed.

    @rrelyea had scenarios (wpf + uwp) where such P2P references make sense without the need for warnings.

  2. nguerrera commented on Jul 21, 2018

    @nguerrera
    Author

    You could log a warning from the task. We spent a lot of time talking about this for package refs and the warning was a big part of pulling the trigger on the AssetTargetFallback default. I don't see how it could be any different for projects, but I'm listening.

  3. nguerrera commented on Jul 21, 2018

    @nguerrera
    Author

    I would like this to be considered for 15.8 because I don't want to end up in a situation where we decide not to make a "breaking change" to add the warning that should always have been there.

  4. nguerrera commented on Jul 21, 2018

    @nguerrera
    Author
  5. terrajobst commented on Jul 21, 2018

    @terrajobst

    I'm surprised to learn this actually works as I was under the impression that this will fail. We must at the very least issue a warning as @nguerrera suggests.

    However, I believe our original design asked for this to be an error. The rationale being that the NuGet case is for references outside your control while P2Ps are expected to be under your control and we want to force developers to convert/modernize from the bottom up. However, I understand that making this an error now would be breaking change. But I don't think silent success here is acceptable behavior.

  6. nguerrera commented on Jul 21, 2018

    @nguerrera
    Author

    However, I understand that making this an error now would be breaking change.

    This is new in 15.8 so technically hasn't shipped. I think there should be a way to do this with project references, I just don't think it should happen without any diagnostics.

  7. terrajobst commented on Jul 21, 2018

    @terrajobst

    This is new in 15.8 so technically hasn't shipped. I think there should be a way to do this with project references, I just don't think it should happen without any diagnostics.

    That's fair. Not sure I wholeheartedly agree, but I could live with a warning, consistent with the NuGet experience. But silence is bad.

  8. added
    Priority:1
    on Jul 21, 2018
  9. added this to the 4.8 milestone on Jul 21, 2018
  10. mishra14 commented on Jul 21, 2018

    @mishra14
    Contributor

    tagging @rrelyea for 4.8 visibility.

  11. self-assigned this
    on Jul 23, 2018
  12. removed this from the 4.8 milestone on Jul 24, 2018
  13. 8 remaining items

  14. rrelyea commented on Jul 25, 2018

    @rrelyea
    Contributor

    @mishra14 - please investigate this fix this morning.

  15. modified the milestones: 4.8, 5.0, 4.9 on Jul 27, 2018
  16. rrelyea commented on Jul 27, 2018

    @rrelyea
    Contributor

    Currently checked into 16.0/5.0 (dev branch).
    Will consider 15.9 as well, so moving to 15.9 for now, to consider.

  17. modified the milestones: 4.9, 5.0 on Nov 20, 2018
  18. changed the title [-]No warning for AssetTargetFallback via P2P[/-] [+]Using a projectreference which requires AssetTargetFallback to succeed, should warn.[/+] on Jan 25, 2019
  19. added and removed
    Type:DCR
    on Jan 25, 2019
  20. changed the title [-]Using a projectreference which requires AssetTargetFallback to succeed, should warn.[/-] [+]Using a ProjectReference which requires AssetTargetFallback to succeed, should warn.[/+] on Apr 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Functionality:RestorePriority:1Type:Bug

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions