-1

I am not sure from where this issue occurs.

I have a python script which uses EasyOCR and has been compiled to an exe. I am using this exe as a process in my asp.NET C# web api to make some OCR validation. When running the exe from command line or running via API from visual studio there is no issue but after I added this API to my local IIS and send a POST request to my API I got the following response from exe.

[WinError 5] Access is denied: 'C:\WINDOWS\system32\config\systemprofile\.EasyOCR'

When I checked the directory there is no folder like this, I tried to create this folder in there but got the same response.

Any help would be appreciated.

Regards

seneill
  • 63
  • 7
  • are you reading/writing to this file? – Vivek Nuna Jan 23 '23 at 11:15
  • Im not using this file, maybe there is a background call in the import. But there is no issue running exe from cmd or Visual studio – seneill Jan 23 '23 at 13:00
  • Not only you need to create that folder, but also need to grant permissions to the application pool identity. Read more in https://halfblood.pro/web-application-differences-in-visual-studio-and-iis-60fec7e311b3 – Lex Li Jan 23 '23 at 16:50

1 Answers1

1

According to this error message, it is usually because the current permissions are insufficient. You can try to execute the program as administrator, or as already mentioned, give permissions to the corresponding application pool. Like this:

enter image description here

Or you could try deploy your site on other on other disk (not the system disk).

Xudong Peng
  • 1,463
  • 1
  • 4
  • 9
  • Thanks, this was the solution and fixed the issue. However i am still not sure why this occured in the first place when i deployed this project to IIS – seneill Jan 24 '23 at 14:29