0

I am trying to read text from images using IronOCR. It worked fine on my dev machine but when I try run it through IIS on another machine I am getting the following error

Access to the path 'C:\Windows\TEMP\Magick.NET.net40.7.4.3.0\Magick.NET-Q8-x64.Native.dll' is denied.

there is no Magick.NET.net40.7.4.3.0 folder in the window temp folder location on the dev machine, but it was there on the other machine but it was empty. I deleted the folder and now it is saying there is access denied on the user app_data folder.

I am totally confused as to why it is looking for access to Magick.NET.net40.7.4.3.0, is there some connection between the 2?

Noelle
  • 772
  • 9
  • 18
  • 44
  • Possible duplicate of [ASP.net Unable to load DLL 'Magick.NET-Q16-x64.Native.dll': Access is denied. (Exception from HRESULT: 0x80070005 (E\_ACCESSDENIED))](https://stackoverflow.com/questions/40219890/asp-net-unable-to-load-dll-magick-net-q16-x64-native-dll-access-is-denied-e) – user247702 Nov 29 '18 at 16:08
  • @Stjin I'm using IronOCR not MagickImage so I don't think so. – Noelle Nov 29 '18 at 16:11
  • IronOCR uses MagickImage internally: https://i.stack.imgur.com/Bw7vT.png – user247702 Nov 29 '18 at 16:16
  • Probably, I only took a quick look at the IronOCR dll. But if I had to guess, looking at the suggested duplicate, MagickImage tries to copy (part of) itself to a temporary directory. Your application pool user will need the correct permissions at a temporary directory of your choice. – user247702 Nov 29 '18 at 16:59

1 Answers1

0

In your code you'll need to set :

IronOcrInstallation.InstallationPath = "d:\newpath" where d:\newpath is a directory on your IIS that your worker process or IIS has access to.

BTW IronOCR is a commercial re-bundling of the open source Magick.NET image and Tesseract OCR libraries.

Jared Forth
  • 1,577
  • 6
  • 17
  • 32