I migrated a collection from TFS 2012.2 to a new TFS 2015, I configured XAML build agent for that collection, when I tried to run the build, it failed during "Associate Changesets and Work Items" activity.
From the stack trace, I can see it couldn't change the work items, I tried to reproduce the case with a small project with the same everything but it worked fine?!
The build log:
Exception Stack Trace: at Microsoft.TeamFoundation.WorkItemTracking.Proxy.WorkItemServer.Update(String requestId, XmlElement package, XmlElement& result, MetadataTableHaveEntry[] metadataHave, String& dbStamp, IMetadataRowSets& metadata)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.SendUpdatePackage(XmlElement package, XmlElement& result, Boolean bulk)
at Microsoft.TeamFoundation.WorkItemTracking.Client.WorkItemStore.SaveWorkItems(WorkItem[] workitems, Boolean bulk, SaveFlags saveFlags)
at Microsoft.TeamFoundation.WorkItemTracking.Client.BatchSaveHelper.TryUpdate(WorkItemStore store, WorkItem[] workitems, SaveFlags saveFlags, List`1 errors)
at Microsoft.TeamFoundation.WorkItemTracking.Client.BatchSaveHelper.TryUpdate(WorkItemStore store, WorkItem[] workitems, SaveFlags saveFlags, List`1 errors)
at Microsoft.TeamFoundation.WorkItemTracking.Client.BatchSaveHelper.BatchSave(WorkItemStore store, WorkItem[] workitems, SaveFlags saveFlags)
at Microsoft.TeamFoundation.Build.Workflow.Activities.WitBatchSaveWorkItems.Execute(CodeActivityContext context)
at System.Activities.CodeActivity`1.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Event Log:
Default Controller - tfsbuild: Cancelled the workflow instance for build vstfs:///Build/Build/430 with ID {2da10eef-3c75-48ce-852b-78436a594f85}. Exception Type:System.NullReferenceException Exception Message:Object reference not set to an instance of an object. Stack Trace: at System.Activities.Statements.Throw.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)