Skip to content

Make bundled targets transitive #36495

Closed
Closed

Description

@natemcmaster

Packages like .UserSecrets and .FileProviders.Embedded bundle some MSBuild targets which are essential to make some API function correctly. A repeated problem customers have with this is detailing with transitive references across ProjectReferences. Today, users must add a direct PackageReference to each and every project that uses these.

As of NuGet/NuGet.Client#2667, we have a way to solve this. See https://github.com/NuGet/Home/wiki/Allow-package--authors-to-define-build-assets-transitive-behavior. By opting into this new behavior, we should be able to ensure targets in packages are imported correctly in to all projects, not just ones with a direct PackageRef.

Activity

  1. added
    untriaged
    on May 15, 2020
  2. added this to the Future milestone on May 15, 2020
  3. removed
    untriaged
    on Jul 1, 2020
  4. maryamariyan commented on Oct 21, 2020

    @maryamariyan
    Contributor

    Seems like an infra issue.

    cc: @ericstj @safern

  5. ViktorHofer commented on Oct 21, 2020

    @ViktorHofer
    Member

    This is about attributing the ProjectReference or the PackageReference items with the right metadata so that they flow transitively. I don't think this is per se an infra issue.

  6. ViktorHofer commented on Oct 21, 2020

    @ViktorHofer
    Member

    @ericstj do you think this would require work in the pkgproj infra?

  7. ericstj commented on Oct 22, 2020

    @ericstj
    Member

    No work needed in infra to support this. The fix is to simply move the props/targets from build to buildTransitive folder. https://github.com/NuGet/Home/wiki/Allow-package--authors-to-define-build-assets-transitive-behavior

    Seems like a good one to do at the start of 6.0.

  8. modified the milestones: Future, 5.0.x, 6.0.0 on Oct 22, 2020
  9. ericstj commented on Oct 22, 2020

    @ericstj
    Member

    Looks like this would only apply to Microsoft.Extensions.Configuration.UserSecrets in dotnet/runtime.
    https://github.com/dotnet/runtime/tree/master/src/libraries/Microsoft.Extensions.Configuration.UserSecrets/src/build/netstandard2.0

    <File Include="..\src\build\netstandard2.0\*" TargetPath="build\netstandard2.0" />

    Microsoft.Extensions.FileProviders.Embedded is in aspnetcore.

  10. ericstj commented on Jul 23, 2021

    @ericstj
    Member

    Given the usage in UserSecrets requires the project to add a property to actually use it I don't think it makes sense to apply those targets transitively. If folks want to use that functionality they can directly reference the package as they do today. Closing this as won't fix.

  11. ghost locked as resolved and limited conversation to collaborators on Aug 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions