Skip to content

[PackageReference] Centrally manage NuGet package versions for a solution or a repo #6764

Closed

Description

@anangaur

PackageReference enhancements are summarized as part of this Epic issue: #6763

Activity

  1. self-assigned this
    on Apr 2, 2018
  2. bording commented on Apr 3, 2018

    @bording

    @anangaur Have you seen https://github.com/Microsoft/MSBuildSdks/tree/master/src/CentralPackageVersions? This seems like it enables the kind of control this requirement is talking about.

  3. anangaur commented on Apr 3, 2018

    @anangaur
    Author

    @bording true that. Thanks.
    @jeffkl @jainaashish we should sync up on this

  4. jainaashish commented on Apr 3, 2018

    @jainaashish

    pretty neat, just wondering how does it work out with VS, if it all it does?

  5. anangaur commented on Apr 3, 2018

    @anangaur
    Author

    Lets see how can we make this mainstream in NuGet and if satisfies all the requirements.

  6. terrajobst commented on Apr 3, 2018

    @terrajobst

    Do we have a strawman for this, design-wise? I'm not sure where that information would be when this is supported across repo boundaries (as the title suggest we do). At that point, this looks like a feature of the feed. It's almost like we'd like to have snapshotted feeds at that point.

  7. anangaur commented on Apr 3, 2018

    @anangaur
    Author

    @terrajobst No designs as such. My current thinking right now is to be able to define it per solution level in a file. And sometimes instead of defining it in the file, it could be imported from some global file present anywhere accessible by NuGet/MSBuild.

    The purpose of keeping the term repo is to help not constrain anything for a 'solution' level. There would be some cases where an app is distributed across solutions in a repo.

    I agree that if this file starts being a list all versions of packages allowed across a team/product - its becomes similar to just being a curated feed/repository.

  8. terrajobst commented on Apr 3, 2018

    @terrajobst

    If we had better tooling for maintaining/populating feeds, creating snapshotted feeds is probably the most logical model. And the file that people need to check in is a nuget.config with the proper feed :-)

  9. changed the title [-]PackageReference - Enable allowed packages/versions across solution/repo/app[/-] [+]PackageReference] Centrally manage NuGet package versions for a solution or a repo[/+] on May 4, 2018
  10. changed the title [-]PackageReference] Centrally manage NuGet package versions for a solution or a repo[/-] [+][PackageReference] Centrally manage NuGet package versions for a solution or a repo[/+] on May 4, 2018
  11. tebeco commented on Dec 31, 2019

    @tebeco

    Hello @anangaur @nkolev92

    As i changed computer and try to find the docs for Directory.Packages.props i found both :

    is the Dup' intended ?

    Also i spotted this in the Wiki page :
    (Sorry the zoom)
    image

    but i have no idea where to submit an issue/PR for the Wiki part

  12. nkolev92 commented on Dec 31, 2019

    @nkolev92
    Member

    As i changed computer and try to find the docs for Directory.Packages.props i found both :

    It is expected. This is tracking an implementation with similar functionality as the SDK you linked.

    Also i spotted this in the Wiki page :

    I edited the wiki to point back to this issue because that spec is just a more elaborate version of the one linked in this issue. :)
    Lots of people came across the spec you linked but could never figure out the right issue back.

  13. tebeco commented on Dec 31, 2019

    @tebeco

    not sure i understand the wiki part of your comment.
    Is it normal to contains twice "github.com" and so that when you click, you are redirected to the wiki home instead of the issue ?

  14. 184 remaining items

  15. nkolev92 commented on Apr 13, 2022

    @nkolev92
    Member

    I also see that the security issue, NU1507, is just a warning. Is there a handy way to promote that to an error?

    @erinlah-ms

    NuGet respects TreatWarningsAsErrors, WarningsAsErrors and NoWarn.

    In your case you might want WarningsAsErrors

  16. japj commented on Apr 14, 2022

    @japj

    With respect to package source mapping, what is the expected way to configure this correctly for the combination of nuget.org and AzureDevOps Azure Artifacts (upstream mirror) feed?

    the nuget.org feed is there to ensure packages can be discovered, but is actually disabled on the build servers

  17. nkolev92 commented on Apr 14, 2022

    @nkolev92
    Member

    @japj
    That's really up to you.
    When we designed the feature, often times the people had different preferences (ex. map out nuget.org, vs map out their private feed).

    https://docs.microsoft.com/en-us/nuget/consume-packages/package-source-mapping#package-pattern-precedence and https://docs.microsoft.com/en-us/nuget/consume-packages/package-source-mapping#setting-default-sources has some details about how to configure things.

  18. ds1709 commented on Jul 29, 2022

    @ds1709

    Is there any sence to place PackageVersions inside Directory.Packages.props? AFAIK, it all works fine if I place PackageVersions just inside Directory.Build.props, so I don't need Directory.Packages.props at all. Correct me if I wrong.

  19. reduckted commented on Jul 29, 2022

    @reduckted
  20. jeffkl commented on Jul 29, 2022

    @jeffkl
    Contributor

    Is there any sense to place PackageVersions inside Directory.Packages.props?

    Since MSBuild basically allows you to do anything you want, you can place your PackageVersions in any common import. However, the supported scenario is to place them in a file that NuGet imports for you so that other tooling can take a dependency on it. Tools like Dependabot might only work with certain files as well so I think anyone should just follow the recommendations for features like this.

  21. CoenraadS commented on Aug 27, 2022

    @CoenraadS

    Today I was reading about the dotnet CLI experience: https://github.com/NuGet/Home/wiki/Centrally-managing-NuGet-package-versions#dotnet-add

    I was encountering the issue that the .csproj is updated, not the Directory.Packages.props

    The documentation mentions:

    It will add a package reference to the project. The Package version will be added only to the Directory.Packages.props file. To update the version in the Directory.Packages.props file use the --force-version-update option.
    

    I made sure to try on latest dotnet
    dotnet --version => 7.0.100-preview.7.22377.5

    I run

    dotnet add .\ClassLibrary1\ClassLibrary1.csproj package Microsoft.Extensions.Logging.Abstractions --version 3.1.28 --force-version-update

    I get the error Unrecognized command or argument '--force-version-update'

  22. JonDouglas commented on Aug 27, 2022

    @JonDouglas
    Contributor

    @CoenraadS That link is just a old specification. It is quite outdated and the most recent docs are found here:

    https://devblogs.microsoft.com/nuget/introducing-central-package-management/

    https://docs.microsoft.com/en-us/nuget/consume-packages/central-package-management

    We do have dotnet add support mostly completed during some intern projects over the summer, but we will need to insert it into the next release and polish it. We will blog/release notes/add docs when that happens. Sorry for the confusion.

  23. reduckted commented on Aug 27, 2022

    @reduckted

    Perhaps it would be a good idea to either remove those pages from the wiki, or add a big disclaimer at the top stating that they are out of date.

  24. JonDouglas commented on Aug 28, 2022

    @JonDouglas
    Contributor

    @reduckted Thanks. I keep forgetting how much SEO this page gets.

    Check out #11952 for our next major iteration.

    Here is a reference for small enhancements last release - #11752

  25. CoenraadS commented on Aug 28, 2022

    @CoenraadS

    Thanks for your responses.

    I took a look at the the next iteration items, but didn't see an item for dotnet add. Is there a issue for it that I can use to track it's progress?

    Some context, I'm looking to try and adopt CPM in my company, however need a good story for automated package bumping. Perhaps there is some alternative way of working to achieve this?

  26. martincostello commented on Aug 28, 2022

    @martincostello

    In case it's useful to you, dependabot version updates already support CPM, which makes it viable for automated package bumping.

  27. CoenraadS commented on Aug 28, 2022

    @CoenraadS

    Turns out NuKeeper also supports it, which surprises me since that project ceased development about a year ago. My company is already using this so great news :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions