I have installed Microsoft.activities.extensions but still facing the same issue as "Invoke code: No compiled code to run
error CS0234: The type or namespace name ‘ResourceHandling’ does not exist in the namespace ‘UiPath.Platform’ (are you missing an assembly reference?) At line -5
Check References:
Open the main XAML file in UiPath Studio.
Go to the “Imports” panel and check if the necessary namespaces are imported. Ensure that UiPath.Platform.ResourceHandling is included.
Reimport Namespaces:
Try to re-import the necessary namespaces in the main XAML file. Make sure that the required namespaces are present and properly referenced.
Restart UiPath Studio:
Close and restart UiPath Studio. Sometimes, issues with assemblies or references may be resolved by restarting the application.
Check for Variable or Argument Names:
Ensure that there are no conflicting variable or argument names that might cause confusion in the main XAML file.
I’m having similar problem with a piece of C# code trying to use System.Windows.Forms namespace. I have checked/done all the items you mentioned
Check References: Imports panel does show the correct namespace “System.Windows.Forms” there
Reimport namespaces: tried delete/import many times
Restart UiPath Studio: tried close/retart many times
Check for variable/argument names: they are different. No confusion possible.
One thing I don’t understand is, if any of the above was not done properly, shouldn’t we see compile error already? There’s no error for the code editor. The issue only happens at runtime. Is this a known bug? I’m using Studio version 2024.10.1.
By the way @vrdabberu the code is very simple, just first create a DialogResult object, then the FolderBrowsingDialog, then show the dialog. That’s it. No fancy stuff.
Funny thing was, it worked initially. After I played around with it a little bit (creating a new sequence xaml, copy and paste to new invoke code activity, run into issue, come back to old xaml, tried to run again. All fails now.
code below
var result = new System.Windows.Forms.DialogResult();
…
var folderBrowserDialog1 = new FolderBrowserDialog
{
Description = “Select the directory you want to save the file”,
ShowNewFolderButton = false,
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.Personal),
UseDescriptionForTitle = true
};
…
result = folderBrowserDialog1.ShowDialog();
//then check the result