TfsVersion fails with "Version is required"

Nov 12, 2012 at 11:10 PM
Edited Nov 12, 2012 at 11:11 PM

I'm trying to get a custom build process going in  I've followed the instructions in the documentation to get the activities in the toolbox and in TFS so that the build controller can use them (and that all seems to be working).  I've also followed steps in the tutorial for the TfsVersion build activity (, but the process fails with "Version is required."  Here's the stack trace:

Exception Message: Version is required (type FailingBuildException)Exception Stack Trace:    at TfsBuildExtensions.Activities.BaseCodeActivity.LogBuildError(String errorMessage) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\MAIN\Source\Common\BaseCodeActivity.cs:line 114   at TfsBuildExtensions.Activities.TeamFoundationServer.TfsVersion.SetVersion() in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\MAIN\Source\Activities\TeamFoundationServer\TfsVersion.cs:line 369   at TfsBuildExtensions.Activities.BaseCodeActivity.Execute(CodeActivityContext context) in d:\Projects\CodePlex\teambuild2010contrib\CustomActivities\MAIN\Source\Common\BaseCodeActivity.cs:line 73   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

Is there something not described in the documentation that I need to do, or perhaps something that's changed in the activity since the documentation was written?

Dec 9, 2012 at 3:41 PM

I suspect you aren't assigning a value to the variable you are passing in as the Version. The only place the code would report his error is in SetVersion


            if (string.IsNullOrEmpty(this.ActivityContext.GetValue(this.Version)))
                this.LogBuildError("Version is required");


Check you are passing in a value.