Skip to content Skip to sidebar Skip to footer

Python - Pyrfc 1.9.5 - Import Error While Calling From IIS Hosted .NET Core API

I am facing the below issue while running a python script from a .NET Core api which is hosted in windows server IIS .I am using pyrfc 1.9.5 SAP connector in this script. Here is t

Solution 1:

Finally I have found the solution after debugging for atleast 1 week. The problem was access related issue. the SAP NW RFC SDK was installed in the path C:\nwrfcsdk\lib as per the documentation.

link : Installation documentation

But the user account under which the .NET Core API was running in the application pool of IIS didn't have any read/write access to this nwrfcsdk folder. Hence pyrfc was not able to import the DLL (SAPNWRFC.dll) when the python script was being called from the .NET Core API.I have provided read/write access to that particular account and the script is running fine now .

I have followed the below steps to debug the diagnose the issue -

  • I have used profiling with Procmon.exe from sysinternals to monitor w3wp.exe IIS worker process and python.exe after calling the API

  • I have also used dependency walker to track the dependent dll.

Hope this helps someone who is facing a similar type of issue.


Post a Comment for "Python - Pyrfc 1.9.5 - Import Error While Calling From IIS Hosted .NET Core API"