Visual Studio / TFS 2013 Upgrade

Nov 2, 2013 at 8:39 PM
Hello Everyone,

Just to let you know that I've pulled the source for TFSVersioning and using the solution in the Main directory and updated the Microsoft.TeamFoundation.* references to point at TFS / VS 2013.

I had to implement one missing property in the TfsBuild.Versioning.Activities.Tests.Stubs project and then it all worked as before.

I'm using it against Team Foundation Service Hosted Build Servers no problem at all.

If someone could guide me uploading the source I'd be happy to do that.

Nov 18, 2013 at 10:52 PM
Edited Nov 20, 2013 at 11:08 PM
Hi John,

I'm afraid the upgrade gets a little more complicated than just upgrading the Microsoft.TeamFoundation.* references...

Here is my setup: I'm using a clean installation of Visual Studio 2013, and I have uploaded the source code of TfsVersioning in Visual Studio Online (formerly known as Team Foundation Service). Now i want to build TfsVersioning via Visual Studio Online.
After changing Microsoft.TeamFoundation.* references to version 12.0, the project compiles fine locally. But if I try to define a build definition for this project to build it via Visual Studio Online, using the DefaultTemplate11.1.xaml, the build fails.

I'm still investigating a solution but i believe the failure comes from the MSBuild activity (there are 2) in the DefaultTemplate11.1.xaml, still using MSBuild 11.0 instead of using 12.0.

I see 2 ways to fix it also i have only tried the first one:
  1. Change the template of the build definition to use the new TfvcTemplate12.xaml, and everything now compiles on the build server.
  2. Change the ToolVersion property of the MSBuild activities in DefaultTemplate11.1.xaml to "12.0" (didnt try yet).
This raise 2 new questions.
  1. Can the new compiled TfsBuild.Versioning.Activities be used as the former one in VersioningBuildTemplate20.xaml
  2. Should the TfsVersioning use the new template TfvcTemplate12.xaml intead of being derived from DefaultTemplate11.1xaml . This new template looks much simpler than the former one, but i don't see where the VersionAssembly activity should be inserted...
Nov 20, 2013 at 10:56 PM
Edited Nov 20, 2013 at 11:07 PM

Small update.
I finally went with the following changes:
  1. Edit solution with VS 2013 and change Microsoft.TeamFoundation.* to version
  2. Implement missing property ContainerId in BuildDetailStub (comes with the new IBuildDetail but is not use in the code anyway). Using a mocking framework like NSubstitute would have made this change unnecessary... just saying...
  3. Create a new DefaultTemplate12.1.xaml from DefaultTemplate.11.1.xaml and edit its definition to force the 2 MSBuild activities to use attribute ToolVersion set to "12.0"
  4. Create a new VersioningBuildTemplate21.xaml from VersioningBuildTemplate20.xaml where you repeat the same change for the 2 MSBuild activities.
  5. Create a build definition for the TfsVersioning solution that uses DefaultTemplate12.1.xaml, everything should compile fine including unit tests on TFS2013 and you can now use the new produced TfsBuild.Versioning.dll. Note that using the new TfvcTemplate12.xaml compiles the solution but fails some of the unit tests. so i didn't use it.
When you want to version a new project, use VersioningBuildTemplate21.xaml to create the build definition and make the build controller use the new TfsBuild.Versioning.dll

With VS2013 you can fully edit the new template, if you need to add your own custom activities. No more red warning when viewing the xaml.

Last, I'm planning to do the exact same thing for Nugetter...