"Index was out of range" error when trying to run FB via TFS 2010

I have everything setup as described in the article concerning using FB with TFS 2010.

When running a build in TFS based on the FinalBuilderBuild.xaml template I get the following error in the FinalBuilder section "Get local source location":

Index was out of range

See part of the diagnostic log included below.

I suspect I need to fill in a parameter unknown to me or that I have filled one with bad data. Any pointers?

 

 

FinalBuilder

00:00

FinalBuilder

17616711:43:18

Get local source location

00:00

Get Build Flavor

Final Property Values
To = Debug
Value = Debug

00:00

Get Build Platform

Final Property Values
To = Any CPU
Value = Any CPU

00:00

Get local FB project location

Final Property Values
Input = $/TDOC/BuildScrips/FBBuildTest.fbp7
Result = M:\SandBox\TDOC\BuildScrips\FBBuildTest.fbp7
Workspace = 1_1_TDBUILD4;GLDK\TDOCBuild

Final Property Values
BuildFlavor = Debug
BuildPlatform = Any CPU
BuildSettings = Build 0 project(s) for 1 platform(s) and configuration(s)
FBProjectFile = $/TDOC/BuildScrips/FBBuildTest.fbp7
Verbosity = Diagnostic
Workspace = 1_1_TDBUILD4;GLDK\TDOCBuild

Final Property Values
MaxExecutionTime = 00:00:00
MaxWaitTime = 04:00:00
ReservationSpec = Name=*, Tags=

Final Property Values
AgentSettings = Use agent where Name=* and Tags is empty; Max Wait Time: 04:00:00
AssociateChangesetsAndWorkItems = True
BuildFlavor = Debug
BuildNumberFormat = $(BuildDefinitionName)_$(Date:yyyyMMdd)$(Rev:.r)
BuildPlatform = Any CPU
BuildSettings = Build 0 project(s) for 1 platform(s) and configuration(s)
CleanWorkspace = Outputs
CreateLabel = True
DropBuild = True
FinalBuilderProjectFile = $/TDOC/BuildScrips/FBBuildTest.fbp7
GetVersion =
MSBuildArguments =
MSBuildPlatform = Auto
PrivateDropLocation =
Verbosity = Diagnostic

Initial Property Values
Input =

Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index

 

Initial Property Values
Value = Debug

 

Initial Property Values
Value = Any CPU

 

Initial Property Values
Input = $/TDOC/BuildScrips/FBBuildTest.fbp7
Workspace = 1_1_TDBUILD4;GLDK\TDOCBuild

Initial Property Values
BuildFlavor = Debug
BuildPlatform = Any CPU
BuildSettings = Build 0 project(s) for 1 platform(s) and configuration(s)
FBProjectFile = $/TDOC/BuildScrips/FBBuildTest.fbp7
Verbosity = Diagnostic
Workspace = 1_1_TDBUILD4;GLDK\TDOCBuild

 

 

Could it have something to do with the fact that I am not using the $(SourceDir) variable to map the Source Control Folder?

Hi Lars,
From your log:

BuildSettings = Build 0 project(s) for 1 platform(s) and configuration(s)


It looks like you haven't selected a project to build in TFS. Even if you're using FinalBuilder to perform the build, you need specify (at least one) solution in the TFS build definition so that TFS knows what to pass to FinalBuilder as the source dir.

"Items to Build" in the build definition should be marked as mandatory, and you should get a warning if its not set.

Cheers,

Ben

I knew it was something like that! :-). Thanks.

Just for info in case anyone else runs into the same problem:

I actually don't have any projects/solutions at all that could succesfully compile. All my projects are Delphi projects. However I just put in \FakeProject.sln and that works as the build process template checks if the solutions file exists before actually running it.

Interesting - when I created the custom TFS action I hadn't considered that people would be using TFS to run non-MS builds. Seems rather obvious now :-)

 
Note that you don't need to specify a *.sln file as the solution - just any path to a file in source control. So, for example, I have "Projects to Build" set to
$/FBWorkflow/BuildProcessTemplates/Basic.fbp7
which means that the %SourceRoot% project is set (via the Get Team Foundation Build Parameters action) to 
C:\Builds2\1\FBWorkflow\Non-VS build\Sources\BuildProcessTemplates
 
Ben

Yes, I am trying to "bend" the system a little. We have been using StarTeam for some years but are now moving to TFS for source control, requirements etc. However all our projects are in Delphi.

I am now getting the error "This project does not appear to be running as part of a TFS build" in the "Get Team Foundation Build Parameters" action. Could you please tell me what logic you are using to determine this?

Again I suspect it has something to do with the fact that I am not actually using the the folder structure expected by TFS, but rather map my workspace folders to a fixed path on the build PC. As you probably know Delphi is using a "Library path" and I am trying to save some time by not having to dynamically change this to match the source folder assigned by the TFS build agent.

 

Cheers,  Lars

Hi Lars,
In the latest official build, The Get Build Parameters action requires all the parameters from TFS to be non-null. My guess is that you had Copy Outputs to Drop Folder in the TFS build definition set to false, which means that the ‘Deployment Share’ parameter isn’t set.

I’ve eased this restriction in the latest test build - it now only requires that the Team Server URL, Team Project Name and Team Build ID are supplied (which should always be the case). You can get the test build from: https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_692.exe

Let me know how it goes.

Cheers,

Ben

You guessed correctly :-)) I am not using the drop functionality.

Everything in my skeleton project is now working as expected. Moving on to fill in the actual compilations etc.

 

As always the support you and the team provide is outstanding!

 

Cheers,  Lars

Glad it’s working - let us know if you run into any other problems.

Cheers,

Ben