We’re facing dificulties trying to make nuget install dependencies of dependencies. We publish custom nugets to an Azure Artifacts with more than one level of dependencies and nuget only installs the first level of these depencencies. As an example:
- Nuget A has a dependency on Nuget B.
- Nuget B has a dependency on Nuget C.
A, B and C are all nugets published in our azure artifacts.
Under this scenario, when we install nuget A in a solution it also installs nuget B (listed as a dependency), but nuget C is not installed (although it is necessary for B to work). Is there a way to accomplish this dependency hierarchy when installing a nuget?
All these nugets were published throughout a pipeline like this one:
parameters:
vmImage: 'windows-latest'
nugetFeed: '(Our_GUID_Feed)'
solution: ''
project: ''
BuildConfiguration: ''
jobs:
- job: Job
pool:
vmImage: '${{ parameters.vmImage }}'
steps:
- task: DotNetCoreCLI@2
displayName: 'Restore packages'
inputs:
command: 'restore'
projects: '${{ parameters.solution }}'
vstsFeed: '${{ parameters.nugetFeed }}'
env:
System_AccessToken: $(System.AccessToken)
- task: DotNetCoreCLI@2
displayName: 'Dotnet Build Project'
inputs:
arguments: '--configuration ${{ parameters.BuildConfiguration }} /p:Version=$(Build.BuildNumber) /p:Optimize=false --no-restore'
projects: '${{ parameters.project }}'
versioningScheme: byBuildNumber
- task: DotNetCoreCLI@2
displayName: 'Dotnet Package Project'
inputs:
command: pack
packagesToPack: '${{ parameters.project }}'
buildProperties: Version=$(Build.BuildNumber)
- task: DotNetCoreCLI@2
displayName: 'Dotnet Push Project'
inputs:
command: push
nuGetFeedType: 'internal'
publishVstsFeed: '${{ parameters.nugetFeed }}'