Fixing “Exception has been thrown by the target of an invocation”
Typically, this SmartConnect error occurs when the VB.NET compiler fails to validate the script, which suggests a possible issue with the VB.NET Compiler.
There are a few things you can do to troubleshoot this issue. Please follow the steps below to identify any of the following methods that might help resolve the error message.
- Repair the .NET Framework.
Download the tool from the Microsoft site here: Microsoft .NET Framework Repair Tool - Run SmartConnect as an administrator (right-click SmartConnect >> Run as administrator) to check if it bypasses any permission-related issues with DLLs or scripts.
If this works, you can ask your IT team to set SmartConnect to always run as administrator by right-clicking it, selecting Properties, going to the Compatibility tab, and enabling Run this program as administrator.
As a workaround for now, you can launch it in administrator mode whenever you need to run the integration manually. - Go to Run >> Type
%temp%, and clear all files in your session. There may be subfolders where SmartConnect validates the script. - Disable the antivirus if it is running. In some cases, the antivirus may block the VB.NET compiler from validating it.
- Verify that no cryptography DLLs or RSA services are active on the machine.
- For additional reference, check out this related help article to troubleshoot via Try-Catch statements: eOne Solutions Help Article.
- For troubleshooting, can you see if the same error occurs when creating a new integration with the same mapping or duplicating an existing one?
- Trace Issue by – to run a procmon trace. Download Process Monitor from Sysinternals/Microsoft and run it. Let the map run again and analyze error logs if you have any access denied or error-related text in the log file.
In most cases, running SmartConnect as an administrator or repairing the .NET Framework fixes the issue.
FAQ: It works when scheduled, but returns an error when run manually. Since the account used by the eOne Windows Service is already part of the local administrators group on the machine, that is likely why it runs successfully when scheduled.
Have a question? Please reach out to us at support@eonesolutions.com