简体   繁体   中英

Artifactory - Hide NuGet Package Version From Visual Studio Feed

Currently we are using Artifactory Professional version 4.16.0 to host all of of our NuGet packages. Recently there has been a need to "hide" older versions of a certain package from our feed in order to prevent users from installing it. We still need the package to be available as some of our legacy applications reference older packages (and they can't be updated for various reasons) therefore our CI requires the packages be available when it does a NuGet restore.

Is there a setting or a configuration to make a specific version of a package invisible in the feed? If so how can I go about doing that?

For example, in Visual Studio MyPackage.1.0.0.nupkg can not be seen on the feed by users however CI can still request it and do a NuGet restore on it. MyPackage.2.0.0.nupkg can be seen on the feed.

Thank You.

Is there a setting or a configuration to make a specific version of a package invisible in the feed? If so how can I go about doing that?

According to the NuGet Repositories , I am afraid there is no such configuration for Artifactory to make a specific version of a package invisible in the feed.

As a workaround, you can add Package versioning to the package on the packages.config or PackageReference , for example, add the allowedVersions="(9.0.1,11.0.1]" to the package Newtonsoft.Json :

<packages>
  <package id="Newtonsoft.Json" version="11.0.1" allowedVersions="(9.0.1,11.0.1]" targetFramework="net462" />
</packages>

After with this setting, when you open the nuget package manager UI, the version of 9.0.1 and below could not be selected:

在此处输入图片说明

Hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM