运行TFS 2015自定义生成任务时出现异常

时间:2016-07-24 09:04:04

标签: tfs tfsbuild tfs2015 azure-pipelines-build-task azure-pipelines

我为TFS 2015开发了一个插件(扩展名) 该插件实际上是一个自定义构建任务,可以作为构建过程中的一个步骤添加。

问题在于,当我开发插件时,我使用了TFS 2015 更新2.1 ,但我的用户使用更新2.0 ,他们在插件启动后不久就看到了这个奇怪的错误在请求用户输入的过程中运行。

执行此行时:

var build = tl.getInput(MyConstants.SomeInput, true);  

发生此错误:

17:46:13.932774 Process logging event with task handler. 17:46:13.932774
---------------------------------------------------------------------------
17:46:13.932774 System.FormatException: Input string was not in a correct format.    
17:46:13.932774    at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)  
17:46:13.932774    at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)    
17:46:13.932774    at System.String.Format(IFormatProvider provider, String format, Object[] args)    
17:46:13.932774    at Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.BaseContext.LogMessageWithDecoration(LoggingVerbosity verbosity, String decoration, String message, Object[] args) 17:46:13.932774    at System.Text.StringBuilder.AppendFormatHelper(IFormatProvider provider, String format, ParamsArray args)    
17:46:13.932774    at System.String.FormatHelper(IFormatProvider provider, String format, ParamsArray args)    
17:46:13.932774    at System.String.Format(IFormatProvider provider, String format, Object[] args)    
17:46:13.932774    at Microsoft.TeamFoundation.DistributedTask.Agent.Worker.Common.BaseContext.LogMessageWithDecoration(LoggingVerbosity verbosity, String decoration, String message, Object[] args) 17:46:13.932774
---------------------------------------------------------------------------

我能够重现此错误,它只存在于更新2.0中,并在我更新到2.1后消失。我已经搜索但在更新2.1更改日志中没有看到任何内容,这意味着任何与我的错误相关的错误修复。

我错过了什么?

1 个答案:

答案 0 :(得分:0)

假设您的扩展程序具有跨平台构建任务。您可以查看Team Foundation Server 2015 Update 2.1 Fixed Bugs。 Build for Update 2中修复了一个错误:

  

具有跨平台构建任务的扩展程序不起作用。