Custom Activity: Object reference not set to an instance of an object

I created a custom activity (library) and added it to another project and when I try to run the project I immediately (before any processing begins) get this error. I’ve created libraries before and not had this issue. The error occurs no matter what I put into the input arguments of the custom activity. I have 3 custom activities in the library, and only one of them gives this error. When I run the custom activity itself in Studio there are no errors.

Error ERROR Validation Error System.NullReferenceException: Object reference not set to an instance of an object.
at FirstHorizon_DocFlow_Activities.DocFlow_Set_Filters.GetImplementation()
at System.Activities.Activity.OnInternalCacheMetadata(Boolean createEmptyBindings)
at System.Activities.Activity.InternalCacheMetadata(Boolean createEmptyBindings, IList1& validationErrors) at System.Activities.ActivityUtilities.ProcessActivity(ChildActivity childActivity, ChildActivity& nextActivity, Stack1& activitiesRemaining, ActivityCallStack parentChain, IList1& validationErrors, ProcessActivityTreeOptions options, ProcessActivityCallback callback) at System.Activities.ActivityUtilities.ProcessActivityTreeCore(ChildActivity currentActivity, ActivityCallStack parentChain, ProcessActivityTreeOptions options, ProcessActivityCallback callback, IList1& 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 System.Activities.Validation.ActivityValidationServices.Validate(Activity toValidate, ValidationSettings settings)
at System.Activities.Presentation.Validation.ValidationService.CoreValidationWork(ValidationReason reason, CancellationToken cancellationToken) Main.xaml

Hi @postwick,
Are you able to share that library and example project? It’s hard to tell what can be wrong there without seeing what’s inside.

I figured it out. Known issue with Studio v2019.10.3 and specifically the Select Item activity. Replacing Select Item with Select Multiple Items fixed the issue, and apparently upgrading to at least 2019.10.4 would also solve the issue.

1 Like

Upgraded to 2020.10.2 and the issue is resolved. Select Item now works properly in custom libraries.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.