Type ‘InArgument(mtbwa:BuildSettings)’ of property ‘BuildSettings’ errors in TFS 2012 RTM builds

I posted a while ago that you saw errors when trying to edit TFS 2012RC build process templates in VS 2012RC if the Visual Studio class library project you were using to manage the process template editing was targeting .NET 4.5, it needed to be 4.0. Well with Visual Studio 2012 RTM this is no longer the case, in fact it is the other way around.

I have recently upgraded our TFS 2012 RC –> RTM and I today came to edit one of our build process templates (using the standard method to edit a process template with custom activities) and got the following error when I tried to open the XAML process template for editing

System.Xaml.XamlException: ‘The type ‘InArgument(mtbwa:BuildSettings)’ of property ‘BuildSettings’ could not be resolved.’ Line number ‘3’ and line position ’38’.

 

image

At first I assumed it was my custom activities, so I tried editing the DefaultTemplate.11.1.xaml in the same manner, but got the same problem.

Strangely I found that if I had no solution open in Visual Studio then I could just double click on the DefaultTemplate.11.1.xaml file in Source Control Explorer and it opened without error. However, if I had a solution open in the same instance of VS2012 that contained a class library project that linked to the same XAML file I got the error. Unloading the project within the solution allowed me to open the file via Source Control Explorer, reloading the project again stopped it loading.

So it all pointed to something about the containing class library project stopping referenced assemblies loading. On checking the project properties I saw that it was targeting .NET 4.0 (as required for the RC), as soon as I changed this to .NET 4.5 it was able to load all the required Team Foundation assemblies and I was able to edit both the default template and my custom build process template.