Skip to content

Removing the use of RefPath and binplacing for old frameworks #31844

Closed

Description

@Anipik

//edited by @ViktorHofer, copied from #31844 (comment)

Make our non-NetCoreAppCurrent projects behave more like normal SDK projects with respect to references.
Eliminate the use of artifacts\bin\ref as the reference path for all frameworks exception NetCoreAppCurrent. Eliminate the need of depprojs.

Next steps:

  • Enable restore for ref and src projects: Enable restore for ref and src projects in libraries #33242
  • Allow non-NetCoreAppCurrent projects to use implicit shared framework (which requires restore).
  • Add PackageReferences to any project that relies on a package that was previously restored by depprojs. EG: System.Memory for NETStandard2.0. Make sure to use version.props to represent the dependency version: Replace binplace.depproj by inlining PackageReferences #33422
  • Handle references to other live-built libraries. EG: System.Collections.Immutable depends on System.Reflection.Metadata. This could either be done with a projectreference to the reference assembly, or a projectreference to the src assembly.
  • Once done for all projects, delete depprojs that were responsible for building out ref packs. Ideally we can delete all depprojs and just meld whatever remaining restores were happening into toolset restore.

cc @ericstj @ViktorHofer

Activity

  1. added
    untriaged
    on Feb 6, 2020
  2. added this to the 5.0 milestone on Feb 6, 2020
  3. ViktorHofer commented on Feb 6, 2020

    @ViktorHofer
    Member

    It has been some time since I last used implicit framework references. Do I remember correctly that when enabling the build would use the default references that come with the framework and by either referencing via ProjectReferences or named references conflict resolution would overrule the default references with the live built references? Does all that apply to .NET Framework as well? cc @ericstj

  4. ericstj commented on Feb 6, 2020

    @ericstj
    Member

    This is more/less true. We may need to fix / modify conflict resolution to work with ProjectReferences: dotnet/sdk#2674. .NETFramework has a behavior defined by SDK + Arcade, we'd use that.

    We better not need conflict resolution with .NETFramework, that would imply we're OOBing .NETFramework assemblies... which isn't very popular... Even so, yes it works for .NETFramework.

    I think in most of our cases we wouldn't need ProjectReferences because we'd instead want to compile against the minimum thing provided by the framework and then our packaging infra would deal with getting the right version for PackageReferences. Testing infra (today) would still run on latest. We'd only need the P2P's when we wanted to use new surface area.

  5. ViktorHofer commented on Feb 6, 2020

    @ViktorHofer
    Member

    We better not need conflict resolution with .NETFramework, that would imply we're OOBing .NETFramework assemblies... which isn't very popular... Even so, yes it works for .NETFramework.

    Funny thing, we already do but not because of any reason, just for consistency with netcoreapp.

    I more or less understand what you are proposing here but I thing we should write this down in more detail.

  6. ViktorHofer commented on Feb 12, 2020

    @ViktorHofer
    Member

    @ericstj just discussed with @Anipik that will tackle this. Can you please help us identify goals and required steps here? Thanks

  7. ericstj commented on Feb 19, 2020

    @ericstj
    Member

    Goal:
    Make our non-NetCoreAppCurrent projects behave more like normal SDK projects with respect to references.
    Eliminate the use of artifacts\bin\ref as the reference path for all frameworks exception NetCoreAppCurrent. Eliminate the need of depprojs.

    Next steps:

    • Enable restore for ref and src projects.
    • Allow non-NetCoreAppCurrent projects to use implicit shared framework (which requires restore).
    • Add PackageReferences to any project that relies on a package that was previously restored by depprojs. EG: System.Memory for NETStandard2.0. Make sure to use version.props to represent the dependency version.
    • Handle references to other live-built libraries. EG: System.Collections.Immutable depends on System.Reflection.Metadata. This could either be done with a projectreference to the reference assembly, or a projectreference to the src assembly.
    • Once done for all projects, delete depprojs that were responsible for building out ref packs. Ideally we can delete all depprojs and just meld whatever remaining restores were happening into toolset restore.
  8. removed
    untriaged
    on Feb 24, 2020
  9. self-assigned this
    on Mar 8, 2020
  10. ViktorHofer commented on Mar 8, 2020

    @ViktorHofer
    Member

    Assigning myself as well as the project restore work is already ongoing. @Anipik my work also covers some of the other todos so I recommend to not start with this work yet until I can clearly draw a line.

  11. ViktorHofer commented on Mar 9, 2020

    @ViktorHofer
    Member

    @ericstj I'm copying your instructions to the top post.

  12. Anipik commented on Mar 9, 2020

    @Anipik
    ContributorAuthor

    Thanks @ViktorHofer for letting me know. I will wait for ur work to go in and then we can evaluate about which tasks are still left.

  13. Anipik commented on Apr 6, 2020

    @Anipik
    ContributorAuthor

    @ViktorHofer can i start working on this now ?

  14. ViktorHofer commented on Apr 6, 2020

    @ViktorHofer
    Member

    Thanks Anirudh but I already started with the next steps in a private branch.

  15. ghost locked as resolved and limited conversation to collaborators on Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions