我一直在尝试使用IronPython导入两个C#.dll。一个叫做m1.sdk.dll,另一个叫做m1.sdk.something.dll。但我得到了错误。错误消息显示它无法在m1.sdk.something.dll中找到类型。
但是它们是通过clr.AddReferenceToFileAndPath()加载并导入IronPython。我看到他们通过clr.References
有没有办法加载这些.dll所以尽管名字点缀IronPython看看同样的模块怎么样?
import clr
clr.AddReferenceToFileAndPath("c:\\path_to_file_\\m1.sdk.dll")
clr.AddReferenceToFileAndPath("c:\\path_to_file_\\m1.sdk.something.dll")
import m1.sdk
import m1.sdk.something # The error occurs here
* Traceback(最近一次调用最后一次):
文件“”,第1行,
ImportError:没有名为*
的模块答案 0 :(得分:0)
您遇到的问题很可能与两个引用的程序集的名称或相似性无关。
如果找不到包含命名空间No module named something
的公共/可见类型,则会出现m1.sdk.something
。