Category Archives: Configuration Management

Opening a TFS 2010 build process template in Visual Studio 2012 – Update

 

A little while back, I posted here about resolving some issues that come up when opening up TFS 2010 build templates for the first time in Visual Studio 2012.

There are two more tips I need to mention that helped me with resolving these issues.

During my last post, I indicated that a tip to help resolve this problem was to re-select some of the TFS Object types in the Variables/Arguments windows.  In addition, you’ll see that the version of these types still point to [10.0.0.0].  With VS2012, the TFS reference version have been bumped up to 11.0.0.0, so this means, we need to do the same with our references.

In my case, I house all my build templates under one umbrella project, which has several TFS references, and as you can see, still points to version 10.

TFSReferences

Simply remove and re-add these references with their version 11.0.0.0 counterparts (screenshot below).

TFSReferencesNewOnce all your references have been upgraded.  You may still see errors in your build templates that say something like Type ‘IBuildDetail’ is not defined.  Turns out the culprit is in the build templates, where there are new references inserted, but because the existing version 10.0.0.0 references are still in there, it causes confusion.  To fix this, I suggest doing so manually, which involves opening up your build templates in code mode.

Simply right-click on your build template file, and choose “View code”.  This opens it up in XAML editor.  As you can see below, there is a reference to Microsoft.TeamFoundation.Build.Client for what seems like version 11.0.0.0 and version 10.0.0.0.  We need to make the version 11 entry fully qualified.

So we go from this:

BuildTemplateXAMLBeforeTo this:

BuildTemplateXAMLAfter

I removed the duplicate reference entries, and fully qualified the newer version.  Do this for any and all TFS references, and your errors should disappear.  Hope this has been helpful.

[UPDATE – 08/29/2013]

After checking in all my changes, I kept getting the below error on my build servers causing my controllers and agents not to start up properly.

BuildWorkflowErrorTurns out TFS didn’t like the specific version on the Microsoft.TeamFoundation.Build.Workflow assembly.  I simply had to remove the specific version notation in my build template code, and let TFS figure out the right version to use.

From this:

xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow, Version=11.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a

To this:

 xmlns:mtbw="clr-namespace:Microsoft.TeamFoundation.Build.Workflow;assembly=Microsoft.TeamFoundation.Build.Workflow"
 xmlns:mtbwa="clr-namespace:Microsoft.TeamFoundation.Build.Workflow.Activities;assembly=Microsoft.TeamFoundation.Build.Workflow"
Tagged , ,

Opening a TFS 2010 build process template in Visual Studio 2012

I recently came across a scenario when trying to edit TFS2010 build process templates within VS 2012, and thought I would share some lessons learned.

When you open up a tfs 2010 build process template within VS 2012, you may get the following error (see below). In my case, I have all my templates linked into a .NET project. Whenever I open the same template outside the project, things seem to be ok, which led to me to think something about the project was causing my headaches.

Build Settings Error

With this information, my next destination were the project settings.  As you can see, the project currently targets the “.NET Framework 4 Client Profile”, so as soon as I changed this to target “.NET Framework 4.5”, the templates began loading succesfully again.  However, it didn’t end there for me.

ProjectTargetFramework

There was one more quirk I found after the template had loaded.  As you can see, the template now indicated it has and error on the “Run MSBuild for Project” activity.

Here is the error message: “Compiler error(s) encountered processing expression Microsoft.TeamFoundation.Build.Workflow.BuildVerbosity.Normal.  ‘BuildVerbosity’ is ambiguous in the namespace ‘Microsoft.TeamFoundation.Build.Workflow'”. 

In examining the properties, it clearly shows it didn’t like the object type for the “Verbosity” property.   The Verbosity(BuildVerbosity) property is mapped to one of my custom arguments which I’ve called, well, Verbosity.

RunMSBuildErrorWithProperty

All I had to do was go to my argument in the Arguments list.  Once I located my “Verbosity” agrument, I clicked on the Argument type column, which should show you a drop down with several options.  Click on the “Browse for types”, and go to the workspace “Microsoft.TeamFoundation.Build.Workflow [10.0.0.0]”, then to “Microsoft.TeamFoundation.Build.Workflow”, and then select “BuildVerbosity” type.  This should resolve the error.

VerbosityARgument

ChooseWorkspace

NOTE: If you use the IBuildDetail or IBuildAgent variable types, you may need to perform the same above step for their respective namespaces.

[UPDATE – 08/27/2013]

Check out an update (with more relevant and detailed info) to this post here.

Tagged , , , ,
%d bloggers like this: