Read PDF With OCR: Expression Activity type 'VisualBasicValue`1' requires compilation in order to run. Please ensure that the workflow has been compiled

Hey all, having this issue while working in C# and have been banging my head against the wall for 2 hours, and ideas?

FileLocation = “Y:\Applications\RPA\Developers\Repository\German\NFY.pdf”


And full error log:

RemoteException wrapping System.NotSupportedException: Expression Activity type 'VisualBasicValue1' requires compilation in order to run. Please ensure that the workflow has been compiled. at System.Activities.Expressions.CompiledExpressionInvoker.InvokeExpression(ActivityContext activityContext) at Microsoft.VisualBasic.Activities.VisualBasicValue1.Execute(CodeActivityContext context)
at System.Activities.CodeActivity1.InternalExecuteInResolutionContext(CodeActivityContext context) at System.Activities.Runtime.ActivityExecutor.ExecuteInResolutionContext[T](ActivityInstance parentInstance, Activity1 expressionActivity)
at System.Activities.InArgument1.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance activityInstance, ActivityExecutor executor) at System.Activities.RuntimeArgument.TryPopulateValue(LocationEnvironment targetEnvironment, ActivityInstance targetActivityInstance, ActivityExecutor executor, Object argumentValueOverride, Location resultLocation, Boolean skipFastPath) at System.Activities.ActivityInstance.InternalTryPopulateArgumentValueOrScheduleExpression(RuntimeArgument argument, Int32 nextArgumentIndex, ActivityExecutor executor, IDictionary2 argumentValueOverrides,
Location resultLocation,
Boolean isDynamicUpdate)
at System.Activities.ActivityInstance.ResolveArguments(ActivityExecutor executor,
IDictionary`2 argumentValueOverrides,
Location resultLocation,
Int32 startIndex)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor,
BookmarkManager bookmarkManager,
Location resultLocation)
— End of stack trace from previous location —
at UiPath.PDF.Activities.OcrReader.ProcessAsync()
at UiPath.PDF.Activities.ReadWithOCRBase.ExecuteAsync(NativeActivityContext context,
CancellationToken cancellationToken)
at UiPath.Shared.Activities.AsyncTaskNativeImplementation.BookmarkResumptionCallback(NativeActivityContext context,
Object value)
at UiPath.Shared.Activities.AsyncTaskNativeActivity.BookmarkResumptionCallback(NativeActivityContext context,
Bookmark bookmark,
Object value)
at System.Activities.Runtime.BookmarkCallbackWrapper.Invoke(NativeActivityContext context,
Bookmark bookmark,
Object value)
at System.Activities.Runtime.BookmarkWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

It compiles fine at runtime with no issues, issue only comes up when running flow.


This might happen because of double quote
Can you check if any double quotes are turned as ” If so replace that with regular "

Hope this may help you


1 Like

Yes that is the first thing I checked due to the other forum posts, but they are all correct.

Hi @David_Hernandez2 ,

Refer the following thread, the issue seems to be same:


1 Like

also, check that the variable FileLocation is correctly declared. Maybe also delete it and retype it into the field

Fixed by placing it into it’s own workflow and invoking it… seems to bug out when other activities are in the same xaml file.

1 Like

@David_Hernandez2 Glad that you have figured it.


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