I am trying to call existing C# dll from Python. I tried both Python for .NET and Iron Python. I put dll (LogAccess.dll) just under the Python root. In the case of Python for .NET, just under the Python27 directory. In the case of IronPython, just under th IPy27.
import sys
import clr
clr.AddReference("LogAccess")
from LogAccess import LogAccess
at this point, error occurs. This is the same situation in Python for .NET and IronPython.
Traceback (most recent call last): File "Untitled", line 4 clr.AddReference('LogAccesss') FileNotFoundException: Unable to find assembly 'LogAccesss'. \u5834\u6240 Python.Runtime.CLRModule.AddReference(String name)
What is wrong ? Is there any condition to make C# dll ? Is there any rule where dll is placed ? I wnat to know relationship among modulename, namespace and main program name/
clr.AddReferenceToFileAndPathin IronPython and an absolute path toLogAccess.dll? This also ensures that the containing folder is added to lookup paths. You could also have a look at the assembly being blocked and not loaded for that reason.