I'm creating Custom Activities in TFS2013 and i'm hitting below issue once build application:
An error occurred while initializing a build for build definition \TestApp\TestApp.Main.CI:
Exception Message: Expression of type 'Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings' cannot be used for return type 'Microsoft.TeamFoundation.Build.Workflow.Activities.BuildSettings' (type ArgumentException)
Exception Stack Trace: at System.Linq.Expressions.Expression.ValidateLambdaArgs(Type delegateType, Expression& body, ReadOnlyCollection`1 parameters)
at System.Linq.Expressions.Expression.LambdaTDelegate
at System.Linq.Expressions.Expression.LambdaTDelegate
at Microsoft.VisualBasic.Activities.VisualBasicHelper.CompileT
at Microsoft.VisualBasic.Activities.VisualBasicHelper.CompileT
at Microsoft.VisualBasic.Activities.VisualBasicHelper.CompileT
at Microsoft.VisualBasic.Activities.VisualBasicValue`1.CacheMetadata(CodeActivityMetadata metadata)
at System.Activities.CodeActivity`1.OnInternalCacheMetadataExceptResult(Boolean createEmptyBindings)
at System.Activities.Activity`1.OnInternalCacheMetadata(Boolean createEmptyBindings)
at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList`1& validationErrors)
at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack`1& activitiesRemaining, ActivityCallStack parentChain, IList`1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback)
at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.ActivityUtilities.CacheRootMetadata(Activity activity, LocationReferenceEnvironment hostEnvironment, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList`1& validationErrors)
at System.Activities.Validation.ActivityValidationServices.InternalActivityValidationServices.InternalValidate()
at Microsoft.TeamFoundation.Build.Workflow.WorkflowHelpers.ValidateWorkflow(Activity activity, ValidationSettings validationSettings)
at Microsoft.TeamFoundation.Build.Hosting.BuildProcessCache.LoadFromXaml(String workflowXaml, TextExpressionImports textExpressionImports)
at Microsoft.TeamFoundation.Build.Hosting.BuildControllerWorkflowManager.PrepareRequestForBuild(WorkflowManagerActivity activity, IBuildDetail build, WorkflowRequest request, IDictionary`2 dataContext)
at Microsoft.TeamFoundation.Build.Hosting.BuildWorkflowManager.TryStartWorkflow(WorkflowRequest request, WorkflowManagerActivity activity, BuildWorkflowInstance& workflowInstance, Exception& error, Boolean& syncLockTaken)
Do you have any ideas? Thank you!
I tried to delete all dlls related to Microsoft.TeamFoundation.* in Custom Assembly folder and restart the services => It works!
来源:https://stackoverflow.com/questions/24176403/expression-of-type-microsoft-teamfoundation-build-workflow-activities-buildsett