TFS 2012 Issue: TF215097 an error occurred while initializing a build for build definition

Audience

Everyone

When you are running a build you get a “TF215097 an error occurred while initializing a build for build definition” message and you don’t even get a build number.

image
Figure: TF215097 an error occurred while initializing a build for build definition

And you get the following nasty long error.

TF215097: An error occurred while initializing a build for build definition NWCTfsCommandLine.Compile: 
Exception Message: Cannot create unknown type '{clr-namespace:TfsBuildExtensions.Activities.TeamFoundationServer;assembly=TfsBuildExtensions.Activities}TfsVersion'. (type XamlObjectWriterException)
Exception Data Dictionary:
MS.TF.Diagnostics.Logged = True

Exception Stack Trace:    at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
   at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
   at System.Activities.XamlIntegration.FuncFactory`1.Evaluate()
   at System.Activities.DynamicActivity.OnInternalCacheMetadata(Boolean createEmptyBindings)
   at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
   at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
   at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
   at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
   at System.Activities.Validation.ActivityValidationServices.InternalActivityValidationServices.InternalValidate()
   at Microsoft.TeamFoundation.Build.Workflow.WorkflowHelpers.ValidateWorkflow(Activity activity, ValidationSettings validationSettings) in d:a1ddalmtfs_coreBuildWorkflowWorkflowHelpers.cs:line 392
   at Microsoft.TeamFoundation.Build.Hosting.BuildProcessCache.LoadFromXaml(String workflowXaml, TextExpressionImports textExpressionImports) in d:a1ddalmtfs_coreBuildMachineHostingBuildProcessCache.cs:line 136
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext) in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 652
   at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken) in d:a1ddalmtfs_coreBuildMachineHostingBuildWorkflowManager.cs:line 628

 No zip file of logs was created because the archive operation failed: System.AggregateException: One or more errors occurred. ---> System.AggregateException: One or more errors occurred. ---> System.Exception: Getting list of logs to archive failed with Http reason: Not Found
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.<archivelogs>d__5.MoveNext() in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 985
   --- End of inner exception stack trace ---
   --- End of inner exception stack trace ---
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.End(IAsyncResult result) in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 954
   at Microsoft.TeamFoundation.Build.Hosting.OperationInvokerPool.EndInvoke(IAsyncResult result) in d:a1ddalmtfs_coreBuildMachineHostingOperationInvokerPool.cs:line 212
---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.Exception: Getting list of logs to archive failed with Http reason: Not Found
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.</archivelogs><archivelogs>d__5.MoveNext() in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 985
   --- End of inner exception stack trace ---
---> (Inner Exception #0) System.Exception: Getting list of logs to archive failed with Http reason: Not Found
   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.</archivelogs><archivelogs>d__5.MoveNext() in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 985< ---
<---
.

 

Applies to

  • Team Foundation Server 2010
  • Team Foundation Server 2012
  • Team Foundation Service

Findings

If you delve into the error and exception log above it looks like it is failing to load a perticulat type

{clr-namespace:TfsBuildExtensions.Activities.TeamFoundationServer;assembly=TfsBuildExtensions.Activities}TfsVersion

This type is actually from the Community TFS Build Extensions project and not one of the built in assemblies. Either the built in build workflows have been changed to include new funcationality or this is a completely custom workflow that loads non standard components.

Solution

You need to load those assemblies into Source Control and set a reference to that location for your controller.

image
Figure: Set the version control path to custom assemblies path

To do this, go to your “Build” page in the new Team Explore. So Go to “Team Explorer| Build | Actions | Manage Build Controllers” and look at your list of Controllers. You should be able to figure out which controller your build is going through from your build settings and if you are on Team Foundation Service it will be called “Hosted Build Controller (Hosted)”.

Select your desired controller and click “Properties” to see the settings that are configured. The one that we care about is the “Version control path to custom assemblies”. Here we need to select a single source folder from which our controller will load any custom assemblies referenced.

Upcoming Training Opportunities

These are the next five classes we have, and you can check out our full public schedule of classes.

Timezone:
Live Virtual Professional Scrum Product Owner online 5th June 2023
Virtual
5-8 Jun, 2023
09:30-13:30 BST
4 half-days
Live Virtual PAL Evidence-Based Management Online on 19th June 2023
Virtual
19-20 Jun, 2023
09:00-13:00 BST
2 half-days
APS 19th June 2023
Virtual
19-22 Jun, 2023
09:00-13:00 EDT
4 half-days
Live Virtual Professional Scrum Master Online on 26th June 2023
Virtual
26-29 Jun, 2023
09:00-13:00 EDT
4 half-days

We can deliver any of our courses as private in-house training over Microsoft Teams & Mural. We also recommend training based on your accountabilities or role, you can go directly to recommended courses for Scrum MastersProduct OwnersDevelopers and Agile Leaders.

Create a conversation around this article

Share on Facebook
Share on Twitter
Share on Linkdin

Related Courses

No items found

Read more

Martin Hinshelwood nkdAgility.com
https://youtu.be/_fFs-0GL1CA Why do you encourage people to follow a certification path in their career journey? I would encourage you to follow a scrum certification path for the same reason that people go to university. The same reason that people do any course or certification. It gets you a foot in …
Martin Hinshelwood nkdAgility.com
https://youtu.be/QGXlCm_B5zA What will you learn on the PSM II course? There are two main things that most scrum masters will learn on the PSM II or Advanced Professional Scrum Master course. That they haven’t been working effectively as a scrum master to date. That they are there to empower and …
Martin Hinshelwood nkdAgility.com
In Scrum Events across the world, I hear repeated the phrase “that’s how agile works” when describing behaviours that are both unprofessional and the very opposite of an agile mindset. These behaviours will inhibit agility and are a result of a lack of understanding of the underlying principles. We need …
Martin Hinshelwood nkdAgility.com
https://youtu.be/klBiNFvxuy0 What is the most common Aha moment people have in a scrum course? It depends on the scrum course they are attending. The content presented in the Applying Professional Scrum (APS) course leads to very different epiphanies when compared to the content presented on an Advanced Professional Scrum Master …

OUR TEAM

We believe that every company deserves high quality software delivered on a regular cadence that meets its customers needs. Our goal is to help you reduce your cycle time, improve your time to market, and minimise any organisational friction in achieving your goals.

naked Agility Limited is a professional company that offers training, coaching, mentoring, and facilitation to help people and teams evolve, integrate, and continuously improve.

We recognise the positive impact that a happy AND motivated workforce, that has purpose, has on client experience. We help change mindsets towards a people-first culture where everyone encourages others to learn and grow. The resulting divergent thinking leads to many different ideas and opportunities for the success of the organisation.