views:

462

answers:

5

Hello,

For the Build Process in TFS 2010 I've created a library containing some custom code activities. In the past it all worked fine by adding the library (*.dll) to Source Control and setting the 'Build Controller - Version Control Path to Custom Assemblies' to the path where the library could be found in Source Control.

But since a few days (and I've been updating the library often) the build doesn't succeed anymore. The error reported is:

TF215097: An error occurred while initializing a build for build definition "Cannot create unknown type '{clr-namespace:BuildTasks;assembly=BuildTasks}'"

After searching I couldn't find any other solution than installing the library to the GAC. That works but I wonder why it is impossible to get it to work without having to install in to the GAC.

So although it working again now, I'd like to get it back to work the old way, without GAC. Hopefully some of you can help me. Thanks in advance.

A: 

Since no answer is given and I haven't found any fix, I decided to put in the GAC now. That works as well. :)

Rhapsody
+1  A: 

This worked for me -- the assembly name needs to be included in the namespace declaration for the custom control:

http://blogs.microsoft.co.il/blogs/royrose/archive/2010/06/09/custom-build-activities-and-tf215097-error.aspx

Mike Livenspargar
Thanks for your response, I checked the xaml file and saw that the assembly name was already included:xmlns:b="clr-namespace:BuildTasks;assembly=BuildTasks" But i'll try to play with it a little bit more.
Rhapsody
+1  A: 

If you want to specify assemblies that contain custom code activities you've written you need to do the following:

  1. Build you custom activities into your workflow.
  2. Make sure your xmlns at the top is defined correctly: xmlns:local="clr-namespace:BuildTasks;assembly=BuildTasks"
  3. Make sure the tags in the XAML for the build process have the local (or whatever prefix you've used) correctly.
  4. Check in your updated workflow XAML into your team project and update your build definitions.
  5. Create a new directory in your team project called "CustomBuildAssemblies"
  6. Go to the bin/Debug (or release) folder of the project that you used to create the custom build tasks (basically get the dll that you're putting in the GAC) and place it into the directory created in step 5.
  7. Tell the build controller where to look for the custom assemblies by going to Team Exporer, selecting the project you're doing this for, expand the project list out and right click on "Builds", and select "Manage Build Controllers". Sellect the controller (should be the first thing in the list) and click properties. Set the version control path to the directory that was created in step 5 (located in the middle of the popup).

At this point you have a custom XAML workflow that is referencing (importing) a custom assembly (or multiple ones) that have been included into source control. The build controller now knows where these custom assemblies are located. This allows you to "check in" new versions of those custom assemblies if you ever need to add/update your custom build tasks.

Hopefully this will help you out. It took me some time to figure this out as well. Let me know if I need to make this any more detailed. I wish I could post some screenshots of the dialogs.

Mike G
Thansk for your reply but I've done it exactly the way you described. In the beginning it was also working, but suddenly it stopped. But I accepted the workaround; by installing the custom code activity assembly into the GAC, it works. :) I don't have the time to figure it out and it works now.
Rhapsody
A: 

You need this attribute on your codeActivity class:

_

Elsewhere, the assembly is not loaded.

Steph
A: 

The Attribute mentioned above is: Microsoft.TeamFoundation.Build.Client.BuildActivity( Microsoft.TeamFoundation.Build.Client.HostEnvironmentOption.Agent )

In general, it really seems like TF215097 can mean "you're stuff is broken" not just "i couldnt find it"

bl0rq