Redeploy Nuget Package

Hi,
I have a problem. I did an upload of a Nuget Package to my local nuget-hosted repository, but with a wrong targetframewrok. The repository is configured to “allow rediploy”, so I tried to do a new deploy with the correct package, under the same version. It worked but the problem is this:
If I do a donwload of the package (.nupkg) from the UI of Nexus, it’s download the correct version (the latest), but if a download the pagkage using a Nuget Client (like Visual Studio), download the original version (with the wrong target).
I tried deleting the original artifact, doing a rebuild index, compacting the blob store but always download the original version.
There is some way to completely delete the original artifact ?

Most NuGet clients will cache the package locally. I suspect when you’re doing the second install from Visual Studio that the “download” is happening from your local cache and not actually going out to Nexus to get the newly published package.

This is why redeploy with the exact same version number is a bad practice. If you published a package incorrectly and have to republish a fix, you should be incrementing at least the patch number portion of the version number. To read more about best practices on version numbering in NuGet, see NuGet Package Version Reference | Microsoft Docs

Taking the next step, you can manage your local cache. See here: How to manage the global packages, cache, temp folders in NuGet | Microsoft Docs. Also, when installing packages, there is an option to skip the cache: Ways to install NuGet packages | Microsoft Docs

1 Like

Thanks. Your answer resolved my problem. I know that is a bad practice but, this is an exceptional situation, due to an error when the package was pushed.