For thoses comming here in 2023 for the same error message, adding the NuGetAuthenticate@0 task before the pack command may be the missing piece:
- task: NuGetAuthenticate@1
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: $(projectPath)
includesymbols: true
includesource: true
versioningScheme: 'off'
verbosityPack: Normal
displayName: 'Dotnet Pack'
For thoses comming here in 2021 for the same error message, adding the NuGetAuthenticate@0 task before the pack command may be the missing piece:
- task: NuGetAuthenticate@1
- task: DotNetCoreCLI@2
inputs:
command: 'pack'
packagesToPack: $(projectPath)
includesymbols: true
includesource: true
versioningScheme: 'off'
verbosityPack: Normal
displayName: 'Dotnet Pack'