【发布时间】:2018-03-21 06:14:30
【问题描述】:
我有一个 .NET Core 2 类库,我试图在 VSTS 中创建一个工件(用于 NuGet 发布,但这是下一个......)
我的“发布构建工件”任务找不到我通过 dotnet publish 发布的文件夹。
dotnet publish 输出:
2018-03-21T06:11:41.2709655Z [command]"C:\Program Files\dotnet\dotnet.exe" publish D:\a\1\s\src\xxx\xxx.csproj --configuration release --output D:\a\1\a\publish
2018-03-21T06:11:41.5475294Z Microsoft (R) Build Engine version 15.6.82.30579 for .NET Core
2018-03-21T06:11:41.5476483Z Copyright (C) Microsoft Corporation. All rights reserved.
2018-03-21T06:11:41.5477091Z
2018-03-21T06:11:42.5040403Z Restore completed in 83.05 ms for D:\a\1\s\src\xxx\xxx.csproj.
2018-03-21T06:11:43.3434895Z xxx-> D:\a\1\s\src\xxx\bin\release\netstandard2.0\xxx.dll
2018-03-21T06:11:43.9833363Z xxx-> D:\a\1\a\publish\
“发布构建工件”任务只是出错并说:
2018-03-21T06:11:44.9159833Z ##[error]Publishing build artifacts failed with an error: Not found PathtoPublish: D:\a\1\a\publish
2018-03-21T06:11:44.9209300Z ##[section]Finishing: Publish Artifact
即使dotnet publish 输出中的最后一行与该行匹配。
这就是我在 VSTS 中所拥有的:
我做错了什么?
【问题讨论】:
-
您的发布构建工件任务看起来很完美,我认为问题出在您的 dotnet 发布任务上,您可以在那里显示配置吗?
-
你需要使用dotnet pack打包项目而不是dotnet publish(查看我的答案),关于dotnet publish的空输出问题,你可以在OneDrive上分享详细日志(设置system.debug变量为真,然后排队构建并共享此日志)
-
感谢你们的帮助。 dotnet pack 就是答案。
标签: .net-core azure-devops azure-pipelines azure-pipelines-build-task