Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to deprecate a nuget package

I have 2 nuget packages for one of my open source projects:

  1. Expressive (.NET full)
  2. Expressive.Standard (.NET Standard)

2 was originally created as an investigation to make sure that it is viable. Now that it is I want to wrap it up under 1 but I can see that there have been people download number 2. While the download numbers aren't huge I still do know want to cause any issues by simply deleting that package.

What would be the best way to migrate people from 2 to the wrapped up version under 1? Would it be to publish a new version of 2 indicating that it is being replaced by 1?

Ultimately I would like to deprecate 2 and indicate that it is being replaced by 1 however I have only been able to find this that doesn't actually show it being implemented.

like image 305
Bijington Avatar asked Mar 07 '23 00:03

Bijington


1 Answers

Nuget recently announced support for deprecating Nuget packages. You can now deprecate Nuget packages.

Steps to deprecate a package

  1. Go to Manage Packages page.
  2. Select your package and click the edit icon.
  3. You will find a deprecation section like the one below. Nuget package deprecation section screenshot
  4. Select the version you want to deprecate. You can select all versions.
  5. Select a reason.
  6. Provide alternate package info if this package is being deprecated in favour of another.
  7. Save the package.

Visual Studio starting from 16.3(Visual Studio 2019) will show a warning for deprecated packages along with a warning message and alternate packages info.

Deprecated Nuget package warning in Visual Studio


Note: Deprecating a package does not unlist the package. You have to unlist the package separately if you want to. It can also be done via Nuget website.

like image 99
Kolappan N Avatar answered Mar 28 '23 00:03

Kolappan N