ARTIFACTORY: Why Artifactory Uses NuGet’s V2 Protocol Instead of V3 When the Client is Sending API V3 Requests
To work with the NuGet v3 API, you'll have to make sure that you're using Artifactory version 6.0 or above. Additionally, for full semver2 support, we recommend that you use NuGet client version 4.3.x or above.
To work with NuGet V3, you'll have add the following:
NuGet CLI
-
Make sure that your NuGet.config file contains protocolVersion=”3” to the relevant sources. On Windows, the default location of this file is %appdata%NuGetNuGet.Config and, on Mac, it's ~/.config/NuGet/NuGet.Config.
Here's a sample configuration that will work against a virtual NuGet repository, called nuget:
<add key=”ArtifactortyV3” value=”https://localhost:8081/artifactory/api/nuget/v3/nuget” protocolVersion=”3” />
- As above, the same holds true for local, remote, and virtual repositories. Changes will point the NuGet client to the v3 feed of the repository and you can test it in your browser:
Visual Studio
Similar to the NuGet CLI, make sure that protocolVersion=3 is added to the NuGet.config file. However, not all Visual Studios have the option to add credentials to the source via the UI. Sometimes you'll have to make sure that you have the next element inside the config file.
Artifactory
If you're working against a NuGet gallery, the URL to the remote repository will be added automatically. In all other cases, this field will be blank and you'll have to enter the URL manually. For example: