BUG: Invoke Code C# breaks when package uninstalled

The Invoke Code activity apparently isn’t cleaned of packages once they are uninstalled. Steps to reproduce:

  1. Create a new project
  2. Add “Excel Application Scope” activity to Main.xaml
  3. Add “Invoke Code” activity to Main.xaml
  4. Set “Invoke Code” “Language” property to “CSharp”
  5. Delete “Excel Application Scope” activity from Main.xaml
  6. 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
studio-version

TestBug.zip (1.8 KB)invoke-code-bug|video

Edit 2: Added step #4

Thank you for the detailed report. This is currently under investigation.