Customize Team Build 2010 – Part 4: Create your own activity

by Ewald Hofman 29. April 2010 12:21

In the series the following parts have been published

  1. Part 1: Introduction
  2. Part 2: Add arguments and variables
  3. Part 3: Use more complex arguments
  4. Part 4: Create your own activity
  5. Part 5: Increase AssemblyVersion
  6. Part 6: Use custom type for an argument
  7. Part 7: How is the custom assembly found
  8. Part 8: Send information to the build log
  9. Part 9: Impersonate activities (run under other credentials)
  10. Part 10: Include Version Number in the Build Number
  11. Part 11: Speed up opening my build process template
  12. Part 12: How to debug my custom activities
  13. Part 13: Get control over the Build Output
  14. Part 14: Execute a PowerShell script
  15. Part 15: Fail a build based on the exit code of a console application
  16. Part 16: Specify the relative reference path

In this post I will show you how you can add your own custom activities. Debugging the customizations is not the best experience. In this post I will show you how I modified the build process template. If you have a better idea, feel free to ping me (because I am never to old to learn :) )

  1. Open a new visual studio 2010 editor and create a new solution with 2 projects (of type Class Library) called Template and BuildTasks. One of the projects is for the custom code and custom activities, the other one to modify the build process template.
  2. Add a project reference from the Template project to the BuildTasks project

    image
  3. Add in the BuildTasks project a reference to the following assemblies:
    1. From c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0
      1. Microsoft.TeamFoundation.Build.Client.dll
    2. System.Activities
  4.   And add the following references to the Template project
    1. From c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ReferenceAssemblies\v2.0
      1. Microsoft.TeamFoundation.Build.Client.dll
      2. Microsoft.TeamFoundation.VersionControl.Client.dll
      3. Microsoft.TeamFoundation.WorkItemTracking.Client.dll
    2. From C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies
      1. Microsoft.TeamFoundation.Build.Workflow.dll
      2. Microsoft.TeamFoundation.TestImpact.BuildIntegration.dll
    3. From C:\Windows\assembly\GAC_MSIL\Microsoft.TeamFoundation.TestImpact.Client\10.0.0.0__b03f5f7f11d50a3a
      1. Microsoft.TeamFoundation.TestImpact.Client.dll
    4. System.Activities
    5. System.Drawing
    6. System.ServiceModel
    7. System.ServiceModel.Activities
    8. System.Xaml
  5. Create a copy of the DefaultTemplate, call it CustomTemplate.xaml and put it in the folder where the Template project is located. Add the file to the project, and set the build action to XamlAppDef. If you don't see the XamlAppDef option, then add an activity to the Template project to add the correct references and then delete it again.
  6. Add to the BuildTasks project two folders called “Activities” and “Library”

    image
  7. Right click on the Activities and choose Add –> New Item. Choose from the dialog to only show the Workflow templates. And choose the Code Activity. Give it the name DoExcitingThings, and close the dialog with OK

    image
  8. In the code we see some interesting things. As we have seen in earlier posts in this series the build heavily relies on activities (such as this code activity) and you can configure activities with Arguments which can be set with the properties window. In the code you decorate every property you want to see in the properties window with the InArgument (or InOutArgument). When you want to get the value of this property, you must use the context to get the value. The property itself won’t hold the value!

    image
  9. I have modified the class so we can see the purpose and usage of the different argument types

    image
  10. We also have to indicate that our activity is used by the Build Controller and the Build Agents. To do this, add a using to the Microsoft.TeamFoundation.Build.Client and decorate the class with the following statement: [BuildActivity(HostEnvironmentOption.All)] 

    If you forget to specify this argument you encounter the error

    "TF21509:An error occured while initializing a build definition \CustomBuildTasks\BuildName:Cannot create
    unknown type '{clr-namepace:NamespaceName,asembly=AssemblyName}Activityname'."

    image
  11. Build the solution
  12. Open the CustomTemplate.xaml file and open the toolbox. In the toolbox we see our new DoExcitingThings activity added.

    image
  13. Drag ‘n drop this activity after the “Get the Build” activity.

    image
  14. When you open the properties window you see the three arguments we have added to our exciting activity.

    image
  15. Lets put in a textual value in all the three arguments

    image
  16. There are errors for the two arguments that have an output value, because it needs to store the value somewhere. So to solve this, you must create a variable for the correct scope (see part 2) and use the variable as value for the argument. You can either set the value for the variable in the variable window itself

     image

    Or you can use the Assign activity which you can find in the Primitives tab

     image
  17. Finally add a WriteBuildMessage to show the values of the arguments after the DoExcitingThings activity.
  18. Save the changes and check-in your CustomTemplate.xaml.
  19. Now execute a build based on the CustomTemplate. The build will fail unfortunately with the following error message

    image
  20. The build controller was unable to load our exciting Code Activity, which is obvious. It is pretty simple to solve this. Open the dialog to manage the build controllers. You can find it when you right click the Builds node for the team project in the team explorer

    image
  21. This will open the following dialog

    image
  22. Select the Controller and open the Properties

    image
  23. You see there a box to specify the path for custom assemblies. This means that you need to have one common location where you store all the assemblies that hold customizations (or just use one assembly that holds all the customizations). Since the assembly is not added by default to source control, you need to add the assembly first to Version Control and then specify that path in here.

    image
  24. Be aware that when you add a file to Source Control that it is marked read-only. So do not use the bin or obj folder! You might want to add some logic to the Post-build event in the C# project to automatically create a copy of the assembly and automatically check it in to Version Control.

    You can use for example the following Post-build event:

    "$(DevEnvDir)\TF.exe" checkout "$/CustomBuildTasks/BuildProcessTemplates/CustomActivities/$(TargetFileName)"
    xcopy /y "$(TargetPath)" "$(SolutionDir)..\..\BuildProcessTemplates\CustomActivities"
    "$(DevEnvDir)\TF.exe" checkin "$/CustomBuildTasks/BuildProcessTemplates/CustomActivities/$(TargetFileName)"
  25. When you now run the build, you will get the following result in the build log

     image

 

You can download the full solution at BuildProcess.zip. It will include the sources of every part and will continue to evolve.

Tags: ,

Team Build | VSTS 2010

Comments

5/13/2010 11:34:53 AM #

Steve

Excellent post - in particular all the assemblies references required to adding a project is something that has not been well-documented. Good job here.

Steve United States |

5/20/2010 6:51:22 AM #

Leo Swiontek

First of all I want to thank you so much Ewald for giving such great examples on how to use WF and code to create custom activities.

For the life of me I can NOT get around the setting of the "version control path to custom assemblies" error:
1 error(s), 0 warning(s)
TF215097: An error occurred while initializing a build for build definition \TeamBuildCustomize\MainCont: Cannot create unknown type '{clr-namespace:BuildTasks.Activities;assembly=BuildTasks}DoExcitingThings'.

I have the assemblie checked in under version control ($/TeamBuildCustomize/Main/Build), and I have my Build controller's "Version control path to custom assemblies" path set to this path, but I keep getting the same error.  What the heck am I doing wrong?

Thanks Ewald!

Leo

Leo Swiontek United States |

5/20/2010 11:54:15 PM #

Ewald Hofman

I have seen this error also in the past, but I can't really recall what I did to solve it.

When I dig very deep into my mind, I think adding the workflow to a project that has a reference to the BuildTasks solved my issue.

Did you follow the exact steps in the post?

Ewald Hofman Netherlands |

5/21/2010 12:50:42 PM #

Leo Swiontek

Thanks for the quick reply.  I believe I've added all the correct references and everything.  Ewald, anyway I can get the exact source code you used?  I could try that out and that would prove right away if I did something wrong, or if its a machine issue.  I am developing on a 64bit OS, and building on a 32bit OS.

Leo Swiontek United States |

5/22/2010 2:30:27 AM #

Ewald Hofman

I added the solution to the post

Ewald Hofman Netherlands |

6/1/2010 12:00:31 PM #

Leo Swiontek

Well, here is the real error I'm getting and I don't know why it is looking for BuildTasks.dll in the 'file:///C:\Users\tfs10build\AppData\Local\Temp\BuildAgent\24\' directory.  This error comes from the Event Viewer for the TF Build Services.  My "Version control path to custom assemblies" is set to $/TeamBuildCustomize/Main/TeamBuildCustomizeBin

Service 'TeamBuildCustomize Agent - buildone' had an exception:
Exception Message: Problem with loading custom assemblies: Could not load file or assembly 'file:///C:\Users\tfs10build\AppData\Local\Temp\BuildAgent\24\BuildTasks.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. (type Exception)

To me Ewald it's like some mapping is screwed up.  Just to let you know that we are still on the VS 2010 Ultimate RC release.  We will soon be upgrading to the RTM release from April.  Any help would be greatly appreciated.  I so want to make this work.

Thanks

Leo Swiontek United States |

6/1/2010 12:11:25 PM #

Ewald Hofman

The problem is not that it cannot find the assembly, but it cannot load it.

I encountered the error with the incorrect format also when mixing with 32 and 64 bit. There are many posts on this subject, like:

www.robertwray.co.uk/.../...as-made-to-load-a.html
blogs.msdn.com/.../...rmat-net-p-invoke-issue.aspx

Ewald Hofman Netherlands |

3/2/2011 12:50:46 PM #

Jay

I am working on a custom activity that uses a dll that wraps the some functionality from the Microsoft.TeamFoundationServer namespace.  From what I can tell, the Microsoft provided TFS dlls are 32 bit and I am getting this incorrect format exception.  Do you have any suggestions on how to get around that?  So the way it lays out is I have a BuildActivities assembly (AnyCPU) that references a TfsWrapper assembly (AnyCPU) that references the Microsoft Team foundation server dll's that appear to be 32 bit.  I should mention that the build machine is 64 bit of course.

Thanks

Jay United States |

6/17/2010 11:06:51 AM #

Leo Swiontek

Yup!  That was it Ewald.  Once I compiled / built everything with "Any CPU" this error went away and I was able to get past this step.  Thanks for your article and your help.

Leo Swiontek |

6/1/2010 12:02:39 PM #

Leo Swiontek

I forgot to mention that the error happens anytime an agent restarts that is tied to the WEdgeOne controller, and 2) I'm developing on a x64 box, and building on a x32 box.

Leo Swiontek |

6/8/2010 2:55:10 AM #

Patrick

I have created all and added to source control the XAML and the  BuildTask.dll from the bin directory. When i open the XAML from the source control i looked at the position at which i put my custom activity, but here is a red label:

Activity could not be loaded because of errors in the XAML.

I added the custom assemblies path in the controller properties to my BuildTask.dll assembly.

In the Toolbox i can see my BuildTasks.Activities, but i couldn´t place this in the XAML there is a deny symbol when i drag it over.

Any ideas?

Patrick Germany |

6/8/2010 3:02:00 AM #

Ewald Hofman

It can be possible that the XAML could not load the BuildTasks.dll

See www.ewaldhofman.nl/.../...stom-assembly-found.aspx for more information.

Another option you have is to spin up another instance of Visual Studio and attach it to the first instance of Visual Studio (Debug -> Attach to Process, choose devenv.exe). Then open the Modules window (Debug -> Windows -> Modules) and check whether the BuildTasks.dll is loaded and which version.

Ewald Hofman Netherlands |

6/10/2010 2:33:42 AM #

Patrick

Hi, i tried to use your BuildProcess, i uploaded the CustomTemplate.xaml in the BuildProcessTemplate. The generated DLLs from the Template project: BuildTasks.dll and Template.dll

Under the controller i set correct the path to these assemblies. So when i open the checked in XAML file in the designer i also get the same error Frown
On the build server i couldn´t find the devenv.exe.config because there is no VS2010 installed, only VS2010 Express.

why must i debug my local VS, i couldn´t undertand it.
Any other ideas?

Patrick Germany |

6/10/2010 5:09:24 AM #

Ewald Hofman

Did you check www.ewaldhofman.nl/.../...stom-assembly-found.aspx

Ewald Hofman Netherlands |

6/11/2010 5:53:36 AM #

Padda

Hi,

I'm having the same problem as Patrick. Is it a case whereby the Build uses the Version Control path to custom assemblies, but Visual Studio itself does not. So, if the CustomTemplates.xaml file is in the BuildProcessTemplates and opened from within TFS (Source Control Explorer), it will open the the xaml but any references for custom activities not in GAC or probing paths won't be found?

When I open the CustomTemplates.xaml file as part of a solution, all references are resolved, and I don't see the "Activity could not be loaded because of errors in the XAML" error.

If this is the expected behaviour, it seems as those something is not quite right.

Padda United Kingdom |

6/12/2010 11:59:04 PM #

Ewald Hofman

You need indeed to open the xaml from within the solution. Since the Build Process Template (the xaml) is now default Windows Workflow 4.0, it is required to do it in this way.

Ewald Hofman Netherlands |

7/13/2010 11:59:55 AM #

Bob Hardister

Hi Ewald, these are great exercises to get started with. Interestly, when I created the team build definition, I chose to build the custom activity solution. The build failed unable to find the reference to -

c:\program files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.TestImpact.BuildIntegration.dll

While this reference worked fine locally (in the IDE), I could not get it to fly in team build. I put the dll in TFS VC and that worked. Also, if I copied it to ...\Common7\IDE\ReferenceAssemblies\v2.0 the team build worked.

Any idea why this is happening? Suggestions?

Thanks!

Bob Hardister United States |

7/13/2010 9:28:03 PM #

Ewald Hofman

In the IDE you have a reference path specified, which is not used in Team Build. See www.ewaldhofman.nl/.../...ncePath-in-TFS-2010.aspx

Ewald Hofman Netherlands |

7/15/2010 9:22:23 AM #

Praneedh

I am getting the following error when Ibuild the project. The asseembly is in the reference list and the private assemblies folder.

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets (1360): Could not resolve this reference. Could not locate the assembly "Microsoft.TeamFoundation.TestImpact.BuildIntegration". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

Praneedh United States |

7/15/2010 11:00:46 AM #

Praneedh

I got the error fixed by adding the assembly into GAC using,

VS CommandPrompt>gacutil /i "C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies\Microsoft.TeamFoundation.TestImpact.BuildIntegration.dll"

Praneedh United States |

9/6/2010 12:04:32 PM #

trackback

TFS2010: Configure IIS from Team Build with a Custom Team Build Workflow Activity

TFS2010: Configure IIS from Team Build with a Custom Team Build Workflow Activity

Benjamin Day Consulting, Inc.: The Blog |

10/7/2010 1:36:09 PM #

Darrell Sveistrup

Been using your article to progress nicely thanks, been a good source of information.

At the moment I am creating a custom activity that calls MSBuild inside my C# code,
But having trouble mapping the context to the MSBuild step so that is executes.

First try I just had this
   MSBuild msbuild = new MSBuild();
   ....... All the setting I need for msBuild .....
   var workflowInvoker = new WorkflowInvoker(msbuild);
   workflowInvoker.Invoke();

Which got the error:
  "DB Compile Exception:An extension of type 'Microsoft.TeamFoundation.Build.Client.IBuildDetail'
   must be configured in order to run this workflow"

Have found example that use this to get the IBuildDetails from context
   IBuildDetail buildDetail = context.GetValue(this.BuildDetail);


That where I get stuck, what to do with that.
Does not seem any where I can set it for use.
So how can you call this MSBuild task in own activity?

Darrell Sveistrup New Zealand |

10/8/2010 12:14:18 PM #

Ewald Hofman

I tried this too in the past and went to the InvokeProcess activity because that suited my needs better.

My I was busy I got the following sample from the product team, which I have never tested though. Maybe it can help you.

                Activity activity = CreateWorkflow();

                // Make sure we do not restrict the activities that run in the tasks
                BuildEnvironment.SetEnvironment(activity, HostEnvironmentOption.All);

                WorkflowInvoker invoker = new WorkflowInvoker(activity);

                if (Tfs != null)
                {
                    invoker.Extensions.Add(Tfs);
                }

                if (BuildDetail != null)
                {
                    invoker.Extensions.Add(BuildDetail);
                }

                Dictionary<String, Object> inputs = new Dictionary<String, Object>(StringComparer.Ordinal);
                IDictionary<String, Object> outputs = invoker.Invoke(inputs, TimeSpan.FromMilliseconds(Int32.MaxValue));

Ewald Hofman Netherlands |

10/10/2010 1:36:09 PM #

Darrell Sveistrup

Thanks for the reply,

I add in:
invoker.Extensions.Add(BuildDetail);

But not sure what the Tfs object is, where did that come from ?

I now get this error
  "DB Compile Exception:An extension of type 'Microsoft.TeamFoundation.Client.TfsTeamProjectCollection' must be configured in order to run
this workflow."

Darrell Sveistrup New Zealand |

10/10/2010 3:50:45 PM #

Darrell Sveistrup

Just wonder if even should be craeting a new WorkflowInvoker
As the context has a WorkflowInstanceId property

Can that be used somehow to create a work flow that same as the calling build process.

protected override void Execute(CodeActivityContext context)
{
   var workflowID = context.WorkflowInstanceId;
}

Darrell Sveistrup New Zealand |

10/20/2010 11:54:19 AM #

Matthew Shin

Thanks for the great post!

Although when I edit my .cs file for editing my custom activity (more specifically, I added some more properties that I can change at activity designer), my activity won't get updated (even after building the solution is complete)!

Is there a way to solve this problem? Or do I have to re-create the custom activity all over again?

Matthew Shin Canada |

10/20/2010 2:51:41 PM #

Ewald Hofman

The workflow reads the activity from a location (you can find that location by attaching another visual studio instance to you devenv process, and then look in the modules debug window). The workflow probably uses a location other then the location where you build your assembly to.

Ewald Hofman Netherlands |

11/9/2010 5:32:28 AM #

trackback

Part 14: Execute a PowerShell script

Part 14: Execute a PowerShell script

Ewald Hofman |

11/10/2010 9:14:20 AM #

pingback

Pingback from blogs.like10.com

TechDays 2010 Presentations « Microsoft Team Foundation Server, SharePoint Server, .NET, and SQL Server

blogs.like10.com |

11/12/2010 9:25:31 AM #

David

Hello, I'm having this issue with my custom assembly. I am able to insert my custom activity into the custom template from within the activity's solution without any errors.

After doing this I check in my changes to the custom template and my custom assembly into the custom assemblies directory path set in the controller properties.

I open the custom template but get this error in place of the custom activity when opening the template directly from VC:

Activity could not be loaded because of errors in the XAML.

The error states: Could not find Task/Activities/TaskName in assembly Task.

When I attach to the devenv process with another instance of VS2010, it shows that the assembly was not loaded. The activity does show up in the toolbox though but I am unable to place it into the template.

David United States |

11/25/2010 6:00:54 AM #

Ewald Hofman

Did you take a look at www.ewaldhofman.nl/.../...stom-assembly-found.aspx

Ewald Hofman Netherlands |

12/16/2010 7:26:34 PM #

John Roh

Hello, Ewald?
Thanks for the great information always that helping me a lot to figure out what I need to do for my daily work.

I do have a question regarding to Tymock isolator (TmockRunner.exe) issue with Team Build 2010. I even just using the Typmock Add I got and tried to build the way how it shows at blogs.blackmarble.co.uk/.../...010-team-build.aspx

TypemockBuildProcessTemplate.xaml shows the work flow build process fine but I can't even drag to any processes at all after I add the activity in the toolbox. Even just trying to build the add-on solution itself giving me the error TF215097: An error occurred while initializing a build for build definition, Cannot create unknown type '{schemas.microsoft.com/netfx/2008/xaml/activities}Activity'. Of course, I followed the instruction in the forum and spent hours to figure out to find the right answers.

Also, I tried to do the build explained at here blogs.blackmarble.co.uk/.../...010-team-build.aspx creating a proj file from MSBuild process or InvokeProcess, the unit test result showing only 22 percent passed.

Nothing seem like working and you're the best hope right now I could get some help from.

would you be able to help?

thanks,

John.

John Roh United States |

12/17/2010 5:51:17 PM #

John Roh

Ewald,

For TypeMock add-on, TypeMockBuildActivity.dll requires to recompile with singing the assembly so that I was able to register into GAC on the build machine. After that I was able to drag that into the build process template. Custom Activity is a bit more harder than what I expected though.

thanks,

John.

John Roh United States |

12/27/2010 2:25:44 PM #

Hari

I am trying to create new activity called copyfile but I failed and I tried with Invoke process also, its giving error.  Can you please explain me how to do this?

Thanks
Hari

Hari United States |

12/27/2010 3:20:44 PM #

John

Hari,

It took me a while to figure this out because TypeMock add on needs to be installed to GAC on the build machine.

try to follow at here msmvps.com/.../...olator-in-vs2010-team-build.aspx

and blogs.blackmarble.co.uk/.../...010-team-build.aspx

I didn't use the Invoke process though....if you open up the typemock add-on source folder, TypemockBuildActivity 1.0.0.0\Source\TypemockBuildActivity\, there is a build template, TypemockBuildProcessTemplate.xaml, which it shows it gets done and I modified the activity (MSTest) for our environment.

Let me know if this doesn't help.

John.



John United States |

1/24/2011 9:18:39 AM #

Hari

Thanks for your reply.

Hari United States |

1/20/2011 9:47:19 AM #

pingback

Pingback from danielcolomb.com

Dependency Replication in TFS 2010 « danielcolomb.com

danielcolomb.com |

1/24/2011 8:13:01 AM #

pingback

Pingback from pyxis-tech.com

How to run Silverlight automated tests on TFS build server? | Pyxis blog

pyxis-tech.com |

3/15/2011 2:40:34 PM #

Jon Hope

Thanks Ewald. This has proved invaluable.

One problem, when I add multiple .xaml files within the BuildTasks.Template project the build fails. One of the errors is as follows:

The type 'TfsBuild.Process' already contains a definition for '_contentLoaded'

This is an error within the g.cs file.  Amending the Build Action of one of the .xaml files resolves the issue.

What should I do to maintain multiple build templates within this project?

Jon Hope United Kingdom |

3/23/2011 1:23:59 PM #

Mr_Miles

Hi - thanks for these instructions, very useful.

I tried to save time and not set up the template project, instead just linking to a copy of the template from the same project as the custom activity.  Big no-no - it really messed up and I could not load the activity for no apparent reason!

Also got bitten by the x86/x64 build options being set by visual studio - setting to any cpu made it go away.

Just for anyone else who ends up here!

Mr_Miles United Kingdom |

3/31/2011 7:08:10 PM #

michael@1300record.com.au

Found it something like
    ''' <remarks></remarks>
    Public Shared Function GetBVTResults(ByVal BuildUri As Uri) As List(Of TestResults)
        Dim Results As New List(Of TestResults)
        Dim Tfs As TfsTeamProjectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(New Uri("************"))
        Dim tcm As TestManagementService = CType(Tfs.GetService(GetType(TestManagementService)), TestManagementService)
        Dim tmtp As ITestManagementTeamProject = tcm.GetTeamProject("***")
        Dim TestRuns As IEnumerable(Of ITestRun) = tmtp.TestRuns.ByBuild(BuildUri)

        For Each TestRun In TestRuns
            If True Then 'If BVT Project
                System.Diagnostics.Debug.WriteLine(TestRun.)
                Dim TextCaseResults As ITestCaseResultCollection = TestRuns(0).QueryResults()
                For Each tcr In TextCaseResults
                    Results.Add(New TestResults("",
                                                tcr.TestCaseTitle,
                                                tcr.Outcome,
                                                tcr.ErrorMessage))
                Next

            End If
        Next

        Return Results
    End Function

michael@1300record.com.au Australia |

4/15/2011 9:59:20 AM #

Craig

Thanks for the tutorial.  This was close enough to what I needed to do that I just make a few modifications and it worked perfectly.  This probably saved me two hours of work.

Craig United States |

4/17/2011 5:20:22 AM #

Trent

Your solution was invaluable. Do you have any idea how many hours we spent trying to come up with a solution to this problem we had, but you helped us tackled it! thanks!

Trent Australia |

4/20/2011 7:23:28 AM #

Berto

Ewald, thx very very much for this post. I got it working without any problem. It's by far the most clear post I've encountered on the net about custom actions in TFS2010.

I do have a question related to this:
When I want to add (as described in step5) another template (e.g. CustomTemplate2.xaml), I get 44 compilation errors. I picked out 2 to get the idea:
"The type 'TfsBuild.Process' already contains a definition for '_BuildSettings'"
"The type 'TfsBuild.Process' already contains a definition for 'BuildSettings'"

It seems to generate this for every argument used.
Can we not use more than 1 template in the solution?
Or let me ask differently: is it really required to 'build' the template since I'm able to use "CustomTemplate2.xaml" succesfully in a build definition?

Thx
Berto

Berto Belgium |

4/20/2011 9:21:00 PM #

Ewald Hofman

You don't have to compile the project with the xaml. Only the project with the code activities

Ewald Hofman Netherlands |

5/6/2011 12:36:58 PM #

Srikrishna

Hi Ewald,

Thanks for excellent posts.Really very useful.
Ewald,we have implemented the process of deploying azure projects into the Cloud from the Build Process parameter.But,instead of directly adding the parameters to Metadata of the template,We have developed some Dialog Components which will have some textboexes to read the azure details.
The functionality is working fine.

But, my question is ,after developing the custom activities do we need to register the DLL in the GAC.Because if we dont register it there, we are not able to load and edit the build definition.If this is the case,do the each and every client machine(Who ever modifiying the build) should need to GAC the DLL ?
Greately appreciate your thoghts on it.
Thanks,
Srikrishna

Srikrishna United Kingdom |

5/17/2011 11:27:06 AM #

Kabilan Jayaraman

Ewald, Thanks for the nice post, actually I like to integrate Visual Build Pro with Team Build 2010, so if a developer wants to do a build, he/she should schedule it in Team build 2010, in turn Team build should get the latest source, increment the build version and the call the Visual build, by passing the parameters - Build version, type of build (DEV/QA), etc.,

Could you guide me how to get this  done?.

Thanks
Kabilan

Kabilan Jayaraman United States |

5/27/2011 1:58:44 PM #

Frank

I cannot make it past step 13. When I drag my new activity to try to place it under "Get the Build" - I am shown the circle with slash (denied!) pointer icon. I have built and rebuilt the project 3 times.

I am building it using VB, but will try again with C#.

Thank you.

Frank United States |

5/31/2011 8:22:01 AM #

trackback

Ewald’s posts on TFS Build 2010

Ewald Hofman , an ALM MVP, has written a great series of blog posts on Team Build in Team Foundation Server 2010.  The 2010 release introduces Windows Workflow as the overall orchestrator of the build process.  Ewald walks you through quite a few topics related to this and the other new features.  Check it out! Part 1: Introduction Part 2: Add arguments and variables Part 3: Use more complex arguments Part 4: Create your own activity Part 5: Increase AssemblyVersion Part 6: Use custom type for an argument Part 7: How is the custom assembly found Part 8: Send information to the build log Part 9: Impersonate activities (run under other credentials) Part 10: Include Version Number in the Build Number Part 11: Speed up opening my build process template Part 12: How to debug my custom activities Part 13: Get control over the Build Output Part 14: Execute a PowerShell script Part 15: Fail a build based on the exit code of a console application Part 16: Specify the relative reference path Technorati Tags: tfs 2010 , team build , windows workflow

Buck Hodges |

1/28/2012 4:05:39 AM #

pingback

Pingback from blogs.like10.com

Define a custom workflow to Deploy Database Project(s) from Team Build 2010  |  Team Foundation Server, SharePoint Server, .NET, and SQL Server

blogs.like10.com |

5/7/2012 5:23:11 AM #

pingback

Pingback from build.futurerepository.com

Build Process Template customization: Microsoft.TeamFoundation.TestImpact.Client.dll is already loaded | Build Future Repository

build.futurerepository.com |

6/23/2013 2:11:42 AM #

pingback

Pingback from blog.petrkozelek.cz

Inconclusive Tests in TFS Build Should Not Break the Build «  Petr Kozelek

blog.petrkozelek.cz |

10/4/2013 1:44:41 PM #

pingback

Pingback from vlaquest.com

Testing your TFS 2012 build workflow activities | Vincent Labatut's Quest

vlaquest.com |

6/27/2014 2:00:47 AM #

pingback

Pingback from msn4free.com

Can’t build a project with a processTemplate.xaml in it | Developers Blog – Msn4Free.com

msn4free.com |

12/7/2014 11:39:06 AM #

pingback

Pingback from dhavalanswers.org

VS 2010 not responding once i open my project ..exception (0x76a0b9bc in devenv.exe)? | Yanez Answers

dhavalanswers.org |

Comments are closed

Powered by BlogEngine.NET 1.6.1.0
Theme by Mads Kristensen


ClusterMap

Widget Statistics not found.

There is an error in XML document (0, 0).X

Recent comments

Comment RSS