Skip to content

Update NuGets included through Directory.Build.propsΒ #10850

Open

Description

@vsfeedback

This issue has been moved from a ticket on Developer Community.


[severity:It's more difficult to complete my work]
I have a Directory.Build.props file in solution folder that includes some NuGets in all of my projects. It works great, but when I'm updating said NuGets (by opening "Manage NuGet Packages for Solution"), VS just adds new version into all of the projects files and doesn't even update the original NuGet reference in Directory.Build.props.

Expected behavior is that VS updates version of PackageReference where that PackageReference is defined instead of creating a new one.

Some NuGets just needs to be added in all projects (like StyleCop or Xamarin.Forms), so it would be great if VS had a full support for such use case.

Currently I have to update version in Directory.Build.props manually.


Original Comments

Feedback Bot on 5/9/2021, 11:00 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

Activity

  1. nkolev92 commented on May 20, 2021

    @nkolev92
    Member

    fyi @JonDouglas - Something to be aware of.

  2. f2calv commented on Aug 19, 2021

    @f2calv
  3. Nirmal4G commented on Jun 21, 2022

    @Nirmal4G

    You could give the user either the choice of updating the file in which the PackageReference/PackageVersion/GlobalPackageReference/CentralPackageReference and PackageDownload were declared or add the update to the projects not just the version but any metadata that can be changed via UI in VS IDE!

  4. JonDouglas commented on Aug 21, 2022

    @JonDouglas
    Contributor

    /cc @martinrrm @jeffkl to consider for 17.4+

  5. jeffkl commented on Aug 29, 2022

    @jeffkl
    Contributor

    Related to #9018

  6. CzBuCHi commented on Jul 7, 2024

    @CzBuCHi

    Its almost 2 years ... so any updates on this?

  7. danmusk commented on Aug 8, 2024

    @danmusk

    Instead of Directory.Build.props maybe we should use Directory.Packages.props

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

  8. nkolev92 commented on Aug 8, 2024

    @nkolev92
    Member

    Updating Directory.Packages.props works today, so if you're using CPM, that should already work.

  9. Skyppid commented on Sep 30, 2026

    @Skyppid

    I don't see how this would work nowadays. When using VS NuGet manager it only shows the projects and while the version number is correct for those using global references, it only updates the versions of projects and does not even show the global reference in the .build.props file. So I can update individual projects but never the build.props references.

    I wonder why that is still not supported properly.

    My assumption is that NuGet itself supports it but Visual Studio does not. Legit since it's in the NuGet repository - but it's also tagged with VisualStudioUI so I assume this is the right place to mention that it's still not supported.

    Likely too niche again for anyone to care implementing this :(

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions