a·gen·tic a·gil·i·ty

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

Explains the TF215097 error in TFS 2012 builds, its cause—missing custom assemblies—and how to resolve it by configuring the build controller to reference those assemblies.

Published on
3 minute read
Image
https://nkdagility.com/resources/Esy-i2Fcamk
Subscribe

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.

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

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

And you get the following nasty long error.

 1TF215097: An error occurred while initializing a build for build definition NWCTfsCommandLine.Compile:
 2Exception Message: Cannot create unknown type '{clr-namespace:TfsBuildExtensions.Activities.TeamFoundationServer;assembly=TfsBuildExtensions.Activities}TfsVersion'. (type XamlObjectWriterException)
 3Exception Data Dictionary:
 4MS.TF.Diagnostics.Logged = True
 5
 6Exception Stack Trace:    at System.Xaml.XamlObjectWriter.WriteStartObject(XamlType xamlType)
 7   at System.Xaml.XamlServices.Transform(XamlReader xamlReader, XamlWriter xamlWriter, Boolean closeWriter)
 8   at System.Activities.XamlIntegration.FuncFactory`1.Evaluate()
 9   at System.Activities.DynamicActivity.OnInternalCacheMetadata(Boolean createEmptyBindings)
10   at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
11   at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
12   at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
13   at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
14   at System.Activities.Validation.ActivityValidationServices.InternalActivityValidationServices.InternalValidate()
15   at Microsoft.TeamFoundation.Build.Workflow.WorkflowHelpers.ValidateWorkflow(Activity activity, ValidationSettings validationSettings) in d:a1ddalmtfs_coreBuildWorkflowWorkflowHelpers.cs:line 392
16   at Microsoft.TeamFoundation.Build.Hosting.BuildProcessCache.LoadFromXaml(String workflowXaml, TextExpressionImports textExpressionImports) in d:a1ddalmtfs_coreBuildMachineHostingBuildProcessCache.cs:line 136
17   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext) in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 652
18   at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken) in d:a1ddalmtfs_coreBuildMachineHostingBuildWorkflowManager.cs:line 628
19
20 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
21   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.<archivelogs>d__5.MoveNext() in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 985
22   --- End of inner exception stack trace ---
23   --- End of inner exception stack trace ---
24   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.End(IAsyncResult result) in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 954
25   at Microsoft.TeamFoundation.Build.Hosting.OperationInvokerPool.EndInvoke(IAsyncResult result) in d:a1ddalmtfs_coreBuildMachineHostingOperationInvokerPool.cs:line 212
26---> (Inner Exception #0) System.AggregateException: One or more errors occurred. ---> System.Exception: Getting list of logs to archive failed with Http reason: Not Found
27   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.</archivelogs><archivelogs>d__5.MoveNext() in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 985
28   --- End of inner exception stack trace ---
29---> (Inner Exception #0) System.Exception: Getting list of logs to archive failed with Http reason: Not Found
30   at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.ArchiveLogsInvoker.</archivelogs><archivelogs>d__5.MoveNext() in d:a1ddalmtfs_coreBuildMachineHostingBuildControllerWorkflowManager.cs:line 985< ---
31<---
32.

Applies to

Findings

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

1{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.

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

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.

Troubleshooting Software Development Install and Configuration
Subscribe

Related Blog

No related videos found.

Connect with Martin Hinshelwood

If you've made it this far, it's worth connecting with our principal consultant and coach, Martin Hinshelwood, for a 30-minute 'ask me anything' call.

Our Happy Clients​

We partner with businesses across diverse industries, including finance, insurance, healthcare, pharmaceuticals, technology, engineering, transportation, hospitality, entertainment, legal, government, and military sectors.​

Illumina Logo

Illumina

Big Data for Humans Logo

Big Data for Humans

SuperControl Logo

SuperControl

Slicedbread Logo

Slicedbread

Akaditi Logo

Akaditi

ProgramUtvikling Logo

ProgramUtvikling

Teleplan Logo

Teleplan

Xceptor - Process and Data Automation Logo

Xceptor - Process and Data Automation

Bistech Logo

Bistech

Flowmaster (a Mentor Graphics Company) Logo

Flowmaster (a Mentor Graphics Company)

YearUp.org Logo

YearUp.org

Epic Games Logo

Epic Games

Freadom Logo

Freadom

Emerson Process Management Logo

Emerson Process Management

Healthgrades Logo

Healthgrades

Cognizant Microsoft Business Group (MBG) Logo

Cognizant Microsoft Business Group (MBG)

Jack Links Logo

Jack Links

Philips Logo

Philips

Nottingham County Council Logo

Nottingham County Council

Department of Work and Pensions (UK) Logo

Department of Work and Pensions (UK)

Washington Department of Enterprise Services Logo

Washington Department of Enterprise Services

New Hampshire Supreme Court Logo

New Hampshire Supreme Court

Ghana Police Service Logo

Ghana Police Service

Washington Department of Transport Logo

Washington Department of Transport

Big Data for Humans Logo

Big Data for Humans

Kongsberg Maritime Logo

Kongsberg Maritime

CR2

SuperControl Logo

SuperControl

Xceptor - Process and Data Automation Logo

Xceptor - Process and Data Automation

Cognizant Microsoft Business Group (MBG) Logo

Cognizant Microsoft Business Group (MBG)