سؤال

I am using Visual Studio online to manage my sources. I am also using Continous Integrations which means my source is compiled in the cloud on the TFS(Visual Studio Online). I have my own build process template and also a few code activities. Since now everything works fine. After I edited the activities and also the template, everytime I start a build, I get the following error:

TF215097: An error occurred while initializing a build for build definition \BuildTest\BuildTasks: 
Exception Message: Expression of type 'Microsoft.TeamFoundation.Build.Workflow.Activities.AgentReservationSpec' cannot be used for return type 'Microsoft.TeamFoundation.Build.Workflow.Activities.AgentReservationSpec' (type ArgumentException)
Exception Data Dictionary:
MS.TF.Diagnostics.Logged = True

A strange side effect is, that the order of the arguments of the build template in Visual Studio is now mingled and there are also some arguments, which are not defined in the template. This happens not only for my custom template, but also for the default templates from Microsoft.

Can anybody help me?

هل كانت مفيدة؟

المحلول 2

I had the same problem with our local TFS instance. I removed all my DLLs from the CustomActivities-Folder in TFS and the error was gone. Now second steop is to identify the CustomAction causing the problem ...

نصائح أخرى

The cause of such errors is due to two versions of the assembly providing the erroneous type being visible simultaneously. The value being assigned from is from one and the value being assigned to is from the other.

This happened to me when I accidentally checked in a load of Microsoft.TeamFoundation assemblies into my custom activities location in source control. Removing these assemblies made the issue go away for me.

Also worth looking out for is if you have more than one version of the TFS API installed on your build controller (multiple versions of Visual Studio will do this). You may need to use explicit versions (full strong name syntax) in the references to TFS assemblies in your projects to ensure the correct API version is loaded.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top