The Invoke Code activity apparently isn’t cleaned of packages once they are uninstalled. Steps to reproduce:
- Create a new project
- Add “Excel Application Scope” activity to Main.xaml
- Add “Invoke Code” activity to Main.xaml
- Set “Invoke Code” “Language” property to “CSharp”
- Delete “Excel Application Scope” activity from Main.xaml
- From “Manage Packages,” uninstall “UiPath.Excel.Activities” package
Result: Attempted run results in CS0234: "The type or namespace name ‘Excel’ does not exist in the namespace ‘UiPath’
Examining the XAML file, you can find references to the Excel packages. The only workaround I’ve found is to manually remove those references from the XAML and then reload the project.
Note that I originally discovered this using a non-default package. I’m using the Excel package only for its simplicity to duplicate. I’ve uploaded a short video demonstrating the bug, as well as the project I created during the video.
EDIT: Adding Studio info and package versions
Edit 2: Added step #4