Conflicts when editing multiple build process templates with TFS 2012

If you followed my small guide, or anyway if you have multiple build process templates in a single solution, you may have encountered this error when compiling with Visual Studio:


“obj\Debug\TfsBuild_Process_BeforeInitializeComponentHelper.txt” was specified more than once in the “Resources” parameter. Duplicate items are not supported by the “Resources” parameter.


This is actually easy to understand. When you add a Xaml workflow file into your solution, Visual Studio sets its properties to be part of the compilation:


Visual Studio generates code and resources out of the Xaml language file, and each Xaml process template has its own class name and namespace (full name). The problem is that generally, TFS build process templates file have the same full class names. The consequence is that there are collisions. Generally, this class name is TfsBuild.Process (hence the name of the TfsBuild_Process_BeforeInitializeComponentHelper.txt resource), because we often duplicate existing build templates.


I’ve seen colleagues changing the Build Action setting it to None:


But you loose the controls issued by the compile process. There is something better do to, simply rename the class or namespace inside the Xaml file:

  • Open the file with the Xml Editor (right-clic => Open With… => XML (Text) Editor)
  • Look for the x:Class attribute on the first line


  • Rename the namespace to something meaningful to you (ex:TfsBuild.Process => TfsBuildUpgrade.Process)
  • On the same line there is another mention of the namespace, rename it there two:


Hopefully, it should now compile fine:

1>------ Rebuild All started: Project: BuildProcessEditing, Configuration: Debug Any CPU ------

1> BuildProcessEditing -> C:\Sources\MyBuildProcess\BuildProcessEditing\bin\Debug\BuildProcessEditing.dll

========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

And the build should still work Winking smile  This way you can put all your build files in the same solution, this is more comfortable! I consider good practice to fix every new build process template I create. Hope this helps!

Leave a Reply

Your email address will not be published. Required fields are marked *