Compiler Error CS0234

I will semi randomly get the following error when I do something that Studio doesn’t like. Compiler error(s) encountered processing expression "string.IsNullOrWhiteSpace(invNo) && Istring.IsNullOrWhiteSpace (CurrentRow["This row"].ToString())".error CS0234: The type or namespace name 'VisualBasic' does not exist in the namespace 'Microsoft.CodeAnalysis' (are you missing an assembly reference?) error CS0234: The type or namespace name "VisualBasic' does not exist in the namespace 'Microsoft.CodeAnalysis' (are you missing an assembly reference?)

The problem is I have no idea what is actually wrong here. If I revert my code back to what it was before the error I get the same error. But this automation worked 30 minutes ago! I had this same error with a stringbuilder last week and ended up reinstalling Studio to get it to quit throwing this error and when I reopened the automation the error was gone when it tried to compile. I have no idea what to do and I am at my wits end with this useless software.

My automations are set to use c# instead of VB as I am familiar with C# and not VB.

Hi @jrhalstead

It’s not your code. UiPath Studio’s compiler cache is corrupted and can’t load Microsoft.CodeAnalysis.VisualBasic (used internally even for C#).

close Studio, clear UiPath and NuGet caches, reopen Studio (or repair Studio if it persists).

Hi @jrhalstead

It’s a UiPath Studio cache / compiler issue + a typo.

  1. Fix typo & use correct VB syntax:
String.IsNullOrWhiteSpace(invNo) AndAlso 
String.IsNullOrWhiteSpace(CurrentRow("This row").ToString)
  1. Restart UiPath Studio
  2. If still failing → delete:
<ProjectFolder>\.local
C:\Users\<you>\.nuget\packages
  1. Reopen project (packages will restore)

Regards,
Gokul