Clr.AddReference ('example_file') - assembly cannot be found
I am trying to add a reference to "example_file.dll" using the AddReference ('example_file') method from the clr module:
>>>import clr
>>>clr.AddReference('example_file')
and as a result we get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
System.IO.FileNotFoundException: Unable to find assembly 'example_file'.
at Python.Runtime.CLRModule.AddReference(String name)
All files are in the current working directory and sys.path looks like this:
>>> sys.path
['', 'C:\\Python27\\lib\\site-packages\\pip-1.2.1-py2.7.egg', 'C:\\Python27', 'C
:\\Windows\\system32\\python27.zip', 'C:\\Python27\\DLLs', 'C:\\Python27\\lib',
'C:\\Python27\\lib\\plat-win', 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27\\lib\\
site-packages', 'C:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\']
In addition, as a result:
>>>clr.FindAssembly('example_file')
I get
u'example_file.dll
The problem arose day after day. I'm confused because it worked well before - I don't know what might affect this. I am working with Windows 7 x64, python 2.73 and .Net framework 4
+3
source to share
1 answer
Is it compiled example_file.dll
against .NET 4?
See Python for .NET "Cannot find assembly" error
and http://sourceforge.net/p/pythonnet/bugs/18/
Has anything changed from "before"?
+2
source to share