Search code examples
tfstfsbuildtfs-2015azure-pipelines-build-taskazure-pipelines

Exception when running TFS 2015 custom build task


I have developed a plugin (extension) for TFS 2015.
The plugin is actually a custom build task that can be added as a step in the build process.

The problem is that when I developed my plugin I used TFS 2015 update 2.1 but my users work with update 2.0 and they see this strange error shortly after the plugin starts running during the process of asking for the user inputs.

When this line is executed:

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

This error occurs:

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
---------------------------------------------------------------------------

I was able to reproduce this error and it exists only in update 2.0 and gone after I updated to 2.1. I have searched but didn't see anything in the update 2.1 change log that implies any bug fix related to my error.

What am I missing?


Solution

  • Assuming your extension have cross-platform Build tasks. You can check Team Foundation Server 2015 Update 2.1 Fixed Bugs. There is a bug fixed under Build for Update 2:

    Extensions that have cross-platform Build tasks do not work.