Deprecating packages on nuget.org

Anand Gaurav

We are excited to announce that nuget.org now supports package deprecation. This has been a long standing ask that will help the ecosystem use supported packages. As a package publisher on nuget.org, you can now deprecate packages that are obsolete, legacy, or buggy. You can also suggest an alternate package to your deprecated package. This lets you guide your packages’ consumers to the latest and greatest package.

Unlisting vs. Deprecating packages

Package deprecation is different than unlisting your package as explained below:

  • Unlisting a package prevents its discovery by removing it from search results.
  • Deprecating a package lets your package’s existing consumers find out if they have it installed or used in their projects. It also lets them know the reason for deprecation and an alternate recommended package as specified by you (the package publisher). Deprecating a package does not unlist the package. As a publisher, you may choose to both unlist as well as deprecate packages.

Deprecating and Un-deprecating packages

Package deprecation is easy. Just follow the following couple of steps:

  1. Go to Manage Packagesmanage packages option

    …and select the package to manage: manage package option 2. Select Deprecation and provide the following required information to deprecate a package:

    • Select version(s): You can choose one or more versions to deprecate. If you’d like, you can deprecate all versions of the package if it is now obsolete or legacy.
    • Select reason(s): You may choose one or more specific reasons or choose a custom reason (select Other) for deprecation.
    • Provide custom message: If you choose Other reason, you must provide a custom message to let the package consumers know the reason.

    deprecating packages

    Note: Currently, the custom message is shown only on nuget.org. It is not visible in clients like dotnet.exe and Visual Studio’s NuGet Package Manager.

    To edit or un-deprecate packages, you can select the versions you deprecated earlier and change or clear the deprecation reasons and save. It’s that simple!

Client experience

Starting Visual Studio 2019 16.3, once a package has been deprecated, you can view the deprecated packages on the Installed tab on Visual Studio’s NuGet Package Manager.

deprecating

You can also run dotnet.exe list package --deprecated from the command line to get a list of deprecated packages in your projects.

For more information on deprecation functionality, refer to the package deprecation documentation. For any related issues, you can open a GitHub issue or reach out to us on Twitter by tagging #nuget or @nuget handle.

0 comments

Discussion is closed.

Feedback usabilla icon