【发布时间】:2021-03-23 10:09:13
【问题描述】:
我正在使用以下步骤来执行解决方案级缓存:
- task: Cache@2
inputs:
key: 'nuget | "$(Agent.OS)" | $(Build.SourcesDirectory)/**/packages.lock.json'
restoreKeys: |
nuget | "$(Agent.OS)"
nuget
path: $(NUGET_PACKAGES)
displayName: Cache NuGet packages
- task: DotNetCoreCLI@2
displayName: 'dotnet restore using package.lock.json'
inputs:
command: 'restore'
restoreArguments: '--locked-mode'
feedsToUse: 'config'
nugetConfigPath: 'nuget.config'
但是,在Post-job: Cache NuGet packages 中有警告:
##[警告]给定的缓存键在恢复和保存步骤之间的解析值发生了变化
我意识到这是因为在解析密钥时也会选择复制到输出目录 */bin/release/net5.0/packages.lock.json 文件的锁定文件。
我该如何解决这个问题?
【问题讨论】:
标签: .net azure-devops nuget azure-pipelines .net-5