Failed to initialise Team Foundation server connection

Hi,

I am using Visual Studio 2010, TFS 2010 and FinalBuilder 6.3.0.2026

When I run a TFS Team build, which include a FinalBuilder project, I receive the following error:

error : Failed to initialise Team Foundation server connection : An item with the same key has already been added.I receive this error before the actions in the FinalBuilder project are executed.

 

Are there any known problems with using Finalbuilder 6 with TFS2010?

Thanx,
Marco

Hi Marco,

Having a quick look around on the web it seems like your error can be caused by the TFS cache becoming corrupted or out of date. There's more information (including scripts to clean the cache) here and here.
 
With TFS2010 Microsoft have changed the build engine from MSBuild to Workflow Foundation. As a result, the VS.NET addin provided with FinalBuilder 6 does not work with TFS2010 and, for now, you cannot create new builds that use FinalBuilder. I'm currently working on a TFS2010 workflow element that will be part of FinalBuilder 7.
 
Because there is no native support for TFS2010 in FinalBuilder 6, I assume that you've upgraded from TFS2008? If cleaning the cache doesn't work please let me know how you created the TFS build and I'll try and reproduce the error. 
 
Regards,
 
Ben
 
 

We are also getting this error, but we are using VS2008 connected to TFS 2010 and FinalBuilder 6.3.0.2172.

You have mentioned that you where working on a fix for FinalBuilder 7, I have installed FB 7.0.0.787, but there does not seem to be any way that I can see to convert our existing TFS builds to use the new FB 7 projects.  Also when I try and create a new Build project it will always try and create a FB 6 project rather than a FB 7 project.  Therefore I am unable to find a way of making our builds work

Any help on this would be most gratefully appreciated.

Sean

Hi Sean,
Please see this article on how to integrate TFS2010 and FinalBuilder: https://www.finalbuilder.com/articles.aspx?ID=38, which will hopefully answer you questions. If not, please let me know.

Ben

Hi Ben,

Thanks for the article, that will help when we upgrade to Visual Studio 2010, but unfortunately we are still using Visual Studio 2008 on the build machine so that does not sort our problem out. We have only migrated the Server to TFS 2010. The projects etc. are still in Visual Studio 2008 and are likely to stay that way for a while yet.

Sean

Hi Sean,
Have you installed the forward compatibility update for VS2008? http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=cf13ea45-d17b-4edc-8e6c-6c5b208ec54d

Have you tried cleaning the TFS cache?

What’s the exact error you’re seeing? And when does it occur?

Also, I’m not quite sure I understand your setup. When you say ‘build machine’, do you mean a TFS build agent?

Sorry for the 20 questions.

Ben

We have installed the forward compatibility update for VS2008 as we can see the server from the PC. We did try cleaning the TFS cache. The error message we are getting is:

C:\Documents and Settings\buildman\Local Settings\Temp\Symphony\Symphony Continuous\BuildType\TFSBuild.proj(222,5): error : Failed to initialise Team Foundation server connection : An item with the same key has already been added.

We get this for all of our continuous builds that we are running from Visual Studio. If I run the FB project directly populating the TFS Build variables manually before hand the build works fine.

The ‘build amchine’ is a machine that is running the TFS build agents has VS2008 installed on it, with the forward compatability installed.

Sean

Thanks for the info. I’m running up a test environment to try and replicate this - will let you know how I go.

Out of interest, are you able to run non-FinalBuilder builds through TFS on the build agent?

Cheers,

Ben

Hi again Sean,
So far I can’t reproduce the error you’re seeing. Here’s my setup:
- TFS Server/Controller: TFS2010 + FinalBuilder 7
- Build agent: TFS2010 build service + VS2008 SP1 + Team Explorer 2008 + FCU + FinalBuilder7

I created a new build definition in Team Explorer 2010, using FinalBuilderBuild.xaml, and successfully ran it on the build machine. I could successfully trigger the build from both Team Explorer 2008 and 2010.

Just to clarify, have you created a new build definition for building with TFS2010? Unfortunately because of the massive change between TFS2008 and 2010 its possible that existing FinalBuilder build definitions won’t be properly upgraded when via the TFS server upgrade process.

Cheers,

Ben

Hi Ben,

Sorry for the delay in getting back, but we have been trying to get a patch release of our software out to a client.

I have now tried creating a new build definition in Team Explorer 2010 using FinalBuilder.xaml.  When I try and run the build from Visual Studio I get a "Object reference not set to an instance of an object." error.  The project runs fine if I run it directly from FinalBuilder 7.

I have done a build with the diagnostic verbose set and attached the resulting log file.

I am at a loss to what object the error is refering to.

Sean

001_Build.zip (55.813 KB)

Hi Sean,
Can you please download the latest test build of FinalBuilder from https://www.finalbuilder.com/downloads/finalbuilder/aex6/FB700_883.exe ? The object reference bug should be fixed in that build.

Please note that you’ll need to re-start the build service and update the XAML templates, as described here: https://www.finalbuilder.com/articles.aspx?ID=43

Cheers,

Ben

Hi Ben,

We are making progress, but I now get the following when I am trying to perform a TFS Get.

FinalBuilder Output
Project File: C:\Builds\3\Symphony\Doco 2010\Sources\TeamBuildTypes\Doco Continuous\Doco Continuous.fbp7
Build Started: 03/12/2010 07:19:20
[Start ActionList: Main]
[Team Foundation Get [ F:\ ]]
Path to Executable: D:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\tf.exe
Workspace Directory: F:\
Command line: get “Symphony\Doco*” “AA\SinglePoint\Doco*” “Symphony\Dev\iExchange\Doco*” “Symphony\Dev\iExchange\Testing\Test Plans*” “Symphony\Symphony iValidate\Doco*” “Symphony\Symphony iValidate\Testing\Test Plans*” “Symphony\Symphony Oracle Restorer\Doco*” “Symphony\Symphony iMatch\Doco*” “iSearchWeb\Doco*” “Symphony\Symphony iPlot\Doco*” “SNN\Doco*” /overwrite /recursive /noprompt
Unable to determine the workspace. You may be able to correct this by running ‘tf workspaces /collection:TeamProjectCollectionUrl’.
Failed!

I have run tf workspaces, but I still get the same error.

Cheers
Sean

Hi Sean,
At least we’re at the stage where FinalBuilder is running. Slow progress, but progress I guess.

Are you using the ‘default working folder’ option in the TFS Get action? FinalBuilder options are per-user: my suspicion is that you’ve set the default working folder when logged in as a user other than the user the one TFS uses to run the build. There’s two ways around this:

1. log in as the user TFS uses, launch FinalBuilder, set the default working directory
2. set the working folder explicitly in the action. If you need to use this in multiple actions, you can use a project variable.

Out of interest, why are you using FB to do your TFS get, rather than the TFS build process? Usually it makes more sense to tell TFS which workspaces to get in the build definition, so it does it when its setting up the build agent.

Cheers,

Ben

Hi Ben,

I have altered the build process to not use the Get, but allow TFS to do this. The project I am using is a fairly basic one that gets the latest version of our documentation and then copies it to certain locations so that other members of the team can then use it. Therefore there is no project to actually build. If I leave the Projects to Build blank in the Process I get the following error from FinalBuilder

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

If I add a project and include it in the Workspaces, then the FinalBuilder project does work.

Hi Sean,
Glad you’re up and running. For info, you should be able to specify any file in TFS as the project to build - it doesn’t have to be a .sln. That way there’s no need to create a dummy project.

Cheers,

Ben