If a package isn't already installed, NuGet first attempts to retrieve it from the cache. If the package is not available in the cache, NuGet tries to download the package from all enabled sources in the list and we have to configure Artifactory here to resolve the packages based on the Nuget client requirement. Here is the sample client configuration.
Configure the Nuget client to resolve package from Artifactory
Configure the Nuget client to resolve package from Artifactory
$ cat ~/.config/NuGet/NuGet.Config <?xml version="1.0" encoding="utf-8"?> <configuration> <packageSources> <add key="Artifactory" value="http://art.local/artifactory/api/nuget/v3/test-nuget" /> <add key="ArtifactoryV2" value="http://art.local/artifactory/api/nuget/test-nuget" /> </packageSources> <packageSourceCredentials> <Artifactory> <add key="Username" value="testadmin" /> <add key="Password" value="XXXXX" /> </Artifactory> <ArtifactoryV2> <add key="Username" value="testadmin" /> <add key="Password" value="XXXXX" /> </ArtifactoryV2> </packageSourceCredentials> <apikeys> <add key="http://art.local/artifactory/api/nuget/test-nuget" value="XXXX" /> <add key="http://art.local/artifactory/api/nuget/v3/test-nuget" value="XXXX" /> </apikeys> </apikeys> </configuration>