VSTS 版本:NuGet 发布者步骤失败

VSTS Release: NuGet Publisher Step Fails

我正在 Visual Studio 在线使用发布功能。我的项目内置在一个 nuget 包中,我想将其发布到 nuget 提要。

我正在成功构建 nuget 包并将其发布到 Artifacts 中,当我尝试浏览 Artifacts 时可以看到所需的文件。然后我切换到 VSO 发布,作为发布的一部分,我有 Nuget Publisher 步骤:

我正在使用 VSO 内部 nuget 提要,地址如下:

https://mytenant.pkgs.visualstudio.com/DefaultCollection/_packaging/myfeedname/nuget/v3/index.json

当我创建新版本时,此步骤失败:

Set workingFolder to default:    
C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetPublisher[=10=].1.39 Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetPublisher[=10=].1.39\NuGetPublisher.ps1 
[error]Cannot bind argument to parameter 'Path' because it is null. 
[error]Cannot bind argument to parameter 'Path' because it is null. Check/Set nuget path Creating Nuget Arguments 
[error]Cannot bind argument to parameter 'Path' because it is null. 
[error]You cannot call a method on a null-valued expression.

显然 nuget 文件路径没有传递给脚本。我还尝试指定 nuget 的确切路径(从下拉列表中选择):

$(System.DefaultWorkingDirectory)\Build & Test\nuget package\MyPackageName.1.1.16014.7.nupkg

但是得到了同样的错误。

只有在VSO Release 中使用此步骤时才会失败。当我使用 Nuget Publisher 步骤作为构建步骤并指定与 **\bin\MyPackageName.*.nupkg 相同的 nuget 提要地址和 "Path/Pattern to nupkg" 时,我将包发布到提要。

知道如何为 VSO 版本修复此错误吗?

UPD:这是日志调试输出

>Set workingFolder to default: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetPublisher[=11=].1.39
>Executing the powershell script: C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\tasks\NuGetPublisher[=11=].1.39\NuGetPublisher.ps1
>[debug]Importing modules
>[debug]Loading module from path 'C:\LR\MMS\Services\Mms\TaskAgentProvisioner\Tools\agents\default\agent\worker\Modules\Microsoft.TeamFoundation.DistributedTask.Task.Internal\Microsoft.TeamFoundation.DistributedTask.Task.Internal.dll'.
>[debug]Importing cmdlet 'Add-BuildAttachment'.
>[debug]Importing cmdlet 'Convert-String'.
>
>...SNIP...
>
>[debug]Importing cmdlet 'Find-Files'.
>[error]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is null.
>[error]   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
>[error]   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
>[error]   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
>[error]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
>[error]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
>[error]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is null.
>[error]   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
>[error]   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
>[error]   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
>[error]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
>[error]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
>[debug]Entering script System.Management.Automation.InvocationInfo.MyCommand.Name
>[debug]Parameter Values
>[debug]searchPattern = C:\a[=11=]dbc15949\**\*.nupkg
>[debug]nuGetFeedType = internal
>[debug]connectedServiceName = 
>[debug]feedName = https://MyName.pkgs.visualstudio.com/DefaultCollection/_packaging/MyFeedName/nuget/v3/index.json
>[debug]nuGetAdditionalArgs = 
>[debug]nuGetPath = 
>Check/Set nuget path
>Creating Nuget Arguments
>[debug]Using provided feed URL
>[error]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is null.
>[error]   at System.Management.Automation.Internal.PipelineProcessor.SynchronousExecuteEnumerate(Object input, Hashtable errorResults, Boolean enumerate)
>[error]   at System.Management.Automation.PipelineOps.InvokePipeline(Object input, Boolean ignoreInput, CommandParameterInternal[][] pipeElements, CommandBaseAst[] pipeElementAsts, CommandRedirection[][] commandRedirections, FunctionContext funcContext)
>[error]   at System.Management.Automation.Interpreter.ActionCallInstruction`6.Run(InterpretedFrame frame)
>[error]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
>[error]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)

这是 Nuget Publisher 步骤full log

这是 bug in the NuGet Publisher task. It was fixed 我们的 Sprint 94 部署。