UiPath Document OCR - Error Performing OCR The Type Initializer For NativeMagickSettings Threw An Exception

Document Understanding Digitize Error - Error performing OCR : The type initializer for 'NativeMagickSettings'; threw an exception.

Issue Description: This issue can occur when the Magick.Native-Q8-x86.dll that is being accessed during project execution is corrupt.

Resolution:

Ideally, it would be best to capture a Procmon trace to confirm the exact location of the Magick.Native-Q8-x64.dll that is being accessed when the issue occurs because the actual location of the corrupt .dll can vary. See Use Process Monitor (ProcMon) to Troubleshoot Issues Related to UiPath Processes KB article.

If unable to capture a Procmon trace to confirm the exact files that are being accessed (and possibly corrupt), as a first step at attempting to resolve the issue, try replacing the Magick.Native-Q8-x64.dll in the %userprofile%\Local\Temp\Magick.NET.net40.7.24.0.0 folder

To do so, follow the steps below:

  1. On the desktop, make a backup copy of the Magick.Native-Q8-x64.dll from the %userprofile%\Local\Temp\Magick.NET.net40.7.24.0.0 folder
  2. After making the backup copy, look for a Magick.Native-Q8-x64.dll in %userprofile%\.nuget\packages\uipath.ocr.activities\<version>\build\<.net version>\runtimes\win-x86\native\ Copy of the Magick.Native-Q8-x64.dll from this location. (Note: This path may vary depending on the version of uipath.ocr.activities that has been installed on the machine.)
  3. Replace the Magick.Native-Q8-x64.dll with the .dll that was copied from step 2 above
  4. Test to see if the issue is resolved.

If the issue is unresolved after attempting the above resolution, share the following with Product Support:

  • Does this issue occur when the process is run from Studio or only when run as Unattended, or both?
  • Share the project (Xamls, project.json, etc) in a zipped folder
  • Does this error occur with any document that the process attempts to digitize, or does it only occur with certain documents? If it only occurs with particular documents, share an example document that the issue occurs with
  • What version of Studio/Robot is in use on the machine where the issue is occurring? Share a screenshot of the Studio / Assistant's version. (In Studio, click on the home tab and find the version in the bottom left corner.)
  • What version of .NET is installed on the machine where the issue is occurring?
  • After causing the error to occur, share the Event Viewer logs from the machine where the issue occurred when running unattended - See How to get Application Logs from the Event Viewer KB article
  • Also share the Robot logs from the machine where the issue occurred. Find the Robot Execution log, Studio log, OCR log from the following location ( %localappdata%/UiPath/Logs) for the appropriate date.
  • Share the Procmon trace if captured as described above .