System.Reflection.TargetInvocationException: Enterprise version - 2024.10.9

I am having a hard time dealing with this error: any ideas how to solve this ?
debugging is such as pain in Studio …

Studio 2024.10.9 - 2/3/2025
Enterprise License
User-mode Installation
License Provider: Orchestrator
Microsoft Windows 11 Enterprise 64-bit
8.0.12

System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. —> System.TypeLoadException: Could not load type ‘Namespace_27aa.Main_Expressions’ from assembly ‘ZZZ_Expressions_Main, Version=1.0.10.0, Culture=neutral, PublicKeyToken=null’. at ZZZ.Main..ctor()
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
— End of inner exception stack trace —
at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions)
at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object args, CultureInfo culture)
at System.Activator.CreateInstanceInternal(String assemblyString, String typeName, Boolean ignoreCase, BindingFlags bindingAttr, Binder binder, Object args, CultureInfo culture, Object activationAttributes, StackCrawlMark& stackMark)
at System.Activator.CreateInstance(String assemblyName, String typeName)
at UiPath.MapFilePathToActivity_93063903935340c8aab522ec692cb083.MapFilePathToActivity(String relativePath)
at UiPath.Executor.WorkflowLoader.LoadWorkflow(String xamlPath, String compiledWorkflowAssemblyName)
at UiPath.Executor.RobotRunner.InitWorkflowApplication()
at UiPath.Executor.RobotRunner.ExecuteJob(Boolean preLoaded)

appreciate your inputs
thank you

Some context is required here.

Hello @Jon_Smith , Thanks for responding. There is not much of a Context here. The bot just won’t start/compile. But the issue is now resolved. There could be various reasons for this error, in my case a reboot worked … don’t know why

That already is context.

We cannot know this error occurs during compile based on you dumping the error out.

In the future add what you are trying to do and what actions are leading to the error, such as trying to publish, and you’re far more likely to get any kind of help, otherwise you’ll just get random guesses from people trying to farm ‘solution points’.

@Sekhar I face the same issue with a different namespace.
It came up when using the new studio version. Processes in production stop working…

What did you reboot? Did you reboot the whole VM or only the robot on the VM?

@PeCour its sometimes worth cleaning some stuff out from the .local folder.

I would strongly recommend against fully deleting it, but deleting the HotReload and Install folder can force it to recompile some stuff that might not be quite right.

Hi @Jon_Smith,
I have deleted some packages and namespaces. I also deleted some namespaces from the .xaml file. This has worked out. I also think it had something to do with the .local folder at the end.

Thank you!

Those extra namespaces shouldnt make a difference I expect, but the new version of Studio did likely have some update to its build logic as the latest STS release contains some updates so you can build your project without publishing it aswell as cleaning out that local folder to try to clear some errors, there is perhaps a conflict with older generated code there that wasnt getting rebuilt as the .local folder is used to store files compiled when building the project.

1 Like

@Jon_Smith you are right. I had to change other projects and there I did leave the namespaces and it worked out. So the reason was something like you described.

I love it when my advice makes it sound like I know exactly what is going on and it fixes it first time :stuck_out_tongue:

1 Like