I am trying to import and use a DLL in python. Therefore I am using pythonnet.
import sys
import clr
sys.path.append('C:\PathToDllFolder')
clr.AddReference('MyDll.dll')
However the code yields the following error:
Traceback (most recent call last): File "E:\NET\NET_test.py", line 6, in <module> clr.AddReference('MyDll.dll') System.IO.FileNotFoundException: Unable to find assembly 'MyDll.dll'. bei Python.Runtime.CLRModule.AddReference(String name)
Target runtime of the DLL is: v4.0.30319
Is there any way to find out why the import is failing and how i can fix it?
(If necessary i can also provide the DLL)
sys.path.append
call and use the full path to the DLL directly withinclr.AddReference
? – Uppercase.dll
? – Limpkindll_ref = System.Reflection.Assembly.LoadFile(fullPath)
– Lachus