I've been searching for alternatives for hours, and I got some really weirdness going on.
So to isolate my problem, I created a very simple code activity that goes inside my xaml template:
using System.Activities;
using Microsoft.TeamFoundation.Build.Client;
using Microsoft.TeamFoundation.Build.Workflow.Activities;
namespace Weco.TeamBuild.FirmwareActivityPack
{
[BuildActivity(HostEnvironmentOption.Controller)]
public sealed class TestActivity: CodeActivity<string>
{
protected override string Execute(CodeActivityContext context)
{
context.TrackBuildMessage("Inside TestActivity", BuildMessageImportance.High);
return "success";
}
}
}
When I tried to run this activity inside the "Run on Agent" sequence, I got the traditional error:
Cannot create unknown type '{clr-namespace:Weco.TeamBuild.FirmwareActivityPack;assembly=FirmwareActivityPack}TestActivity'.
I do have the assembly where the TestActivity resides checked in source control, and my build controller points to it as recommended in several articles online.
The interesting factor is that when I place a copy of that activity at the very top of my template, it runs fine (but only the first TestActivity). It looks like the "Version Control Path to Custom Assemblies" is only valid for the build controller, and not for the agents. I'm trying to avoid having to install/uninstall anything in my build server's GAC.
FYI, TFS is installed on machine_1, and Team Build (controller + 4 agents) is installed on machine_2