Share via


TF215097: Cannot create unknown type when using pure XAML actions.

While trying to add some customization to my build process (you know, those wheel spinners) I ran into this error

TF215097: An error occurred while initializing a build for build definition \Sandbox\SandboxWithPostProc: Cannot create unknown type '{clr-namespace:BuildActivityPack;assembly=BuildActivityPack}Activity1'.

I binged around the web for a while and found some articles. You have to add your path to the test controller. Done, but still getting the error. Eventually I had to get some help from the VSTS team. I discovered that my solution couldn't be loaded because TFS is looking for a particular attribute to my class. This is the code that fixed my problem. Notice that I had to use a partial class definition to get the attribute added. It's not avialable in XAML.

namespace BuildActivityPack
{
/// <summary>
/// By default tfs only load dlls with activities that have the buildactivity attribute
/// </summary>
[Microsoft.TeamFoundation.Build.Client.BuildActivity(Microsoft.TeamFoundation.Build.Client.HostEnvironmentOption.All)]
partial class Activity1
{
}
}