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

**URL:** https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598
**Category:** Discussion
**Created:** [September 15, 2010, 3:15am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598 "2010-09-15T03:15:06Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![lsondergaard](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lsondergaard](https://www.finalbuilder.com/forums/u/lsondergaard)
#### Post date: [September 15, 2010, 3:15am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/1 "2010-09-15T03:15:06Z")

</div>

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?

&nbsp;

&nbsp;

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

 

&nbsp;

Initial Property Values  
Value = Debug

&nbsp;

Initial Property Values  
Value = Any CPU

&nbsp;

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

&nbsp;

&nbsp;

---

<div class="post-metadata">

### Author: ![lsondergaard](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lsondergaard](https://www.finalbuilder.com/forums/u/lsondergaard)
#### Post date: [September 16, 2010, 10:55am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/2 "2010-09-16T10:55:54Z")

</div>

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

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [September 17, 2010, 5:39am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/3 "2010-09-17T05:39:02Z")

</div>

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

---

<div class="post-metadata">

### Author: ![lsondergaard](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lsondergaard](https://www.finalbuilder.com/forums/u/lsondergaard)
#### Post date: [September 17, 2010, 7:37am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/4 "2010-09-17T07:37:39Z")

</div>

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&nbsp;succesfully compile. All my projects are Delphi projects.&nbsp;However I just put in&nbsp;\FakeProject.sln and that works as the build process template checks if the solutions file exists before actually running it.

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [September 17, 2010, 9:11am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/5 "2010-09-17T09:11:43Z")

</div>

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

&nbsp;

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&nbsp;

> C:\Builds2\1\FBWorkflow\Non-VS build\Sources\BuildProcessTemplates

&nbsp;

Ben

---

<div class="post-metadata">

### Author: ![lsondergaard](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lsondergaard](https://www.finalbuilder.com/forums/u/lsondergaard)
#### Post date: [September 19, 2010, 11:44am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/6 "2010-09-19T11:44:55Z")

</div>

Yes, I am&nbsp;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.

&nbsp;

Cheers,&nbsp; Lars

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [September 20, 2010, 12:27pm UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/7 "2010-09-20T12:27:26Z")

</div>

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](https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_692.exe)   
  
 Let me know how it goes.   
  
 Cheers,   
  
 Ben

---

<div class="post-metadata">

### Author: ![lsondergaard](https://www.finalbuilder.com/forums/letter_avatar_proxy/v4/letter/l/dfb087/32.png) [@lsondergaard](https://www.finalbuilder.com/forums/u/lsondergaard)
#### Post date: [September 20, 2010, 7:17am UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/8 "2010-09-20T07:17:18Z")

</div>

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.

&nbsp;

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

&nbsp;

Cheers,&nbsp; Lars

---

<div class="post-metadata">

### Author: ![deleted\_user](https://www.finalbuilder.com/forums/user_avatar/www.finalbuilder.com/deleted_user/32/937_2.png) [@deleted\_user](https://www.finalbuilder.com/forums/u/deleted_user)
#### Post date: [September 21, 2010, 12:18pm UTC](https://www.finalbuilder.com/forums/t/index-was-out-of-range-error-when-trying-to-run-fb-via-tfs-2010/1598/9 "2010-09-21T12:18:33Z")

</div>

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