Validation Error's source

After updating, the validation error occurs and I even couldn’t know which step is the source.

Error ERROR Validation Error
System.ArgumentNullException: Value cannot be null. (Parameter ‘text’)
at Microsoft.CodeAnalysis.Text.SourceText.From(String text, Encoding encoding, SourceHashAlgorithm checksumAlgorithm)
at System.Activities.Validation.CSharpExpressionValidator.GetSyntaxTreeForExpression(String expressionText)
at System.Activities.Validation.RoslynExpressionValidator.AddExpressionToValidate(ExpressionToValidate expressionToValidate, StringBuilder expressionBuilder, Int32 index)
at System.Activities.Validation.RoslynExpressionValidator.Validate(Activity currentActivity, ValidationScope validationScope, ValidationSettings validationSettings)
at System.Linq.Enumerable.SelectManySingleSelectorIterator2.MoveNext() at System.Collections.Generic.List1.AddRange(IEnumerable`1 collection)

at System.Linq.Enumerable.ConcatIterator1.ToList()
at System.Activities.Validation.ActivityValidationServices.InternalActivityValidationServices.InternalValidate()
at System.Activities.Presentation.Validation.ValidationService.CoreValidationWork(ValidationReason reason, CancellationToken cancellationToken)
Main.xaml

Context helps…
Updating what?
Error from where?

Hi @rosamonde88,

This error can occur due to an argument with an empty or invalid expression. Please check your workflow arguments (Input/Output/InOut), especially any arguments that were recently modified or are not mapped correctly after the update.

Try to run in Debug mode.

Thanks

Hello @rosamonde88,

What is Updated activity package or some code?

Please try the below checks:

  1. Open View → Error List in UiPath Studio and double-click the validation error.
    Sometimes Studio navigates directly to the activity that has the missing expression.

  2. If double-clicking does not navigate, manually check the recently modified or migrated activities, especially:

    • Assign activities with empty To or Value fields
    • If / While / Switch activities with missing conditions
    • Invoke Workflow File argument mappings
    • Log Message / Write Line / Throw activities with empty required fields
    • UI activities where Boolean properties are blank after migration
  3. Since this happened after an update, also check activities whose package version was upgraded. In one similar case, the issue was caused by an empty property in an On Element Appear activity. After filling the missing Repeat Forever value, the workflow validated successfully. Ref: Value cannot be null . Parameter name : expression file: main.xaml - Help / Studio - UiPath Community Forum similary you might be missing something please validate / review the workflow properly.

Thanks,
Karthik

Thanks for your helpful advice.