But it works on my PC!

The random thoughts of Richard Fennell on technology and software development

Two problems editing TFS2012 build workflows with the same solution

Updated 30th Aug 2012: This post is specific to TFS/VS 2012 RC - for details on the RTM see this updated post

Whilst moving over to our new TFS2012 system I have been editing build templates, pulling the best bits from the selection of templates we used in 2010 into one master build process to be used for most future projects. Doing this I have hit a couple of problems, turns out the cure is the same for both

Problem 1 : When adding custom activities to the toolbox Visual Studio crashes

See the community activities documentation for the process to add a items to the toolbox, when you get to step to browse for the custom assembly you get a crash.

clip_image002

Problem 2: When editing a process template in any way the process is corrupted and the build fails

When the build runs you get the error (amongst others)

The build process failed validation. Details:
Validation Error: The private implementation of activity '1: DynamicActivity' has the following validation error:   Compiler error(s) encountered processing expression "BuildDetail.BuildNumber".
Type 'IBuildDetail' is not defined.

 

image

 

 

The Solution

Turns out the issue that caused both these problems was that the Visual Studio class library project I was using to host the XAML workflow for editing was targeting .NET 4.5, the default for VS2012. I changed the project to target .NET 4.0, rolled back the XAML file back to an unedited version and reapplied my changes and all was OK.

Yes I know it is strange, as you never build the containing project, but the targeted .NET version is passed around VS for building lists and the like, hence the problem.

Comments (2) -

  • Duat Le

    7/31/2012 4:36:39 AM |

    Hi Richard,

    We fixed the issue in VS 2012 RTM. I haven't seen the first problem myself but the second problem is exactly what you described. Once RTM is released, please give it a try (you need to update both your client and build machine) and let me know if you still experience these problems.

    Thanks,
    Duat

  • Art Gola

    9/14/2012 4:11:22 PM |

    This answered my question as to why my Build Definition was all of a sudden showing a bunch of errors when I opened it in VS2010 without a project loaded (after I installed VS2012), but worked fine if I first opened a .NET4 project in VS2010 and then opened the build definition.  My guess is that VS2010 must be defaulting to the .NET4.5 Workflow engine if there is no project open.  Thanks for the explanation -- now if only there was someway to fix this.

Pingbacks and trackbacks (1)+

Comments are closed