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
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.
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.
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
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.