System error at initialization: Exception has been thrown by the target of an invocation. at Source: mscorlib

Hello,

I have a problem executing a process published in the Orchestrator.
The process is created with REFramework and when running from Orchestrator, I will generate the following log as a result:
Time, Level, Message
8/11/2019 1:17:20 PM, Info execution started
8/11/2019 1:17:22 PM, Info Killing processes …
8/11/2019 1:17:24 PM, Fatal System error at initialization: Exception has been thrown by the target of an invocation. at Source: mscorlib
8/11/2019 1:17:26 PM, Info Closing applications …
8/11/2019 1:17:29 PM, Info execution ended

The local execution works correctly.

The process initially when it was developed, was published in orchestrator and worked correctly. Subsequently, it took a virtual machine (Windows Server 2016) and adjustments were made. It was republished, working correctly in Local, but executing the process from the Orchestrator, throws the error
“System error at initialization: Exception has been thrown by the target of an invocation. At Source: mscorlib” and I am not able to deduce the problem.

I am sorry I cannot give more details but I cannot deduce or obtain more information about the problem.

Any suggestions?

I have consulted some similar solutions to the problem that I pose, but the solutions do not fit this problem. I have done tests to clean the project, deleted hidden files and others. I have also removed the Orchestrator package and republish it and the error persists.

It is frustrating to see that the execution on my local computer works correctly and when executing the process from Orchestrator does not work.

After much research, I have finally found the source of the error. In a sequence, I used the “Invoke code” activity, through which I delete the Exception_Screenshots directory. Commenting on this activity and re-executing the process, it worked without problems. Investigating, I have read in an article that this activity can cause synchronization problems.