.net-core - VSTS - dotnet restore - PackageCache 不存在
问题描述
我正在尝试在 vsts 托管代理上构建一个 .net 核心 webapi 项目。我在多个项目中使用相同的 yaml,它工作正常:
- task: DotNetCoreCLI@1
displayName: Restore
inputs:
command: restore
projects: '$(ProjectName).Backend/*.csproj'
但是,今天,在一个新项目上,dotnet restore
给了我以下错误:
2018-06-23T09:23:21.5607282Z ##[section]Starting: Restore
2018-06-23T09:23:21.5610673Z ==============================================================================
2018-06-23T09:23:21.5610898Z Task : .NET Core
2018-06-23T09:23:21.5611078Z Description : Build, test and publish using dotnet core command-line.
2018-06-23T09:23:21.5611445Z Version : 1.0.2
2018-06-23T09:23:21.5612188Z Author : Microsoft Corporation
2018-06-23T09:23:21.5612456Z Help : [More Information](https://go.microsoft.com/fwlink/?linkid=832194)
2018-06-23T09:23:21.5613271Z ==============================================================================
2018-06-23T09:23:22.0071300Z [command]"C:\Program Files\dotnet\dotnet.exe" restore D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj
2018-06-23T09:23:24.2324967Z Restoring packages for D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj...
2018-06-23T09:23:24.5505741Z Restoring packages for D:\a\1\s\MyApp.Dtos\MyApp.Dtos.csproj...
2018-06-23T09:23:24.5506660Z C:\Program Files\dotnet\sdk\2.1.300\NuGet.targets(114,5): error : The local source 'D:\a\1\s\PackageCache' doesn't exist. [D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj]
2018-06-23T09:23:25.8083235Z ##[error]Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1
2018-06-23T09:23:25.8094330Z ##[error]Dotnet command failed with non-zero exit code on the following projects : D:\a\1\s\MyApp.Backend\MyApp.Backend.csproj
2018-06-23T09:23:25.8105780Z ##[section]Finishing: Restore
解决方案
虽然我不明白为什么我在那个项目而不是其他项目上得到了错误,但一旦我将 vsts 任务升级到DotNetCoreCLI@2
.
推荐阅读
- python - 调用具有未知数量参数Python的函数
- arrays - JOLT 删除嵌套 JSON 中的列表级别
- python - 在 Python 中为 SeleniumBase 运行 pytest 时如何从其他函数获取输入变量?
- python - 带有两个条件的while循环
- typescript - 在类中的另一个数组中添加数组以保存对象
- python - conv1d pytorch中的自定义权重初始化
- r - 如何从 Promise 管道中提取值
- python - 我在将我的 python 数据(例如股票数据)导出到 Excel 文档时遇到问题
- regex - 使用 RegEx 复制行
- python - 将 csv 文件转换为没有任何库的列表列表,并保留一些列