【发布时间】:2012-03-03 02:04:08
【问题描述】:
在 IronPython 2.7.1 中,我可以按名称导入一些 .NET 程序集:
>>> from System.Collections import *
>>> from System.IO import *
别人给我报错:
>>> from System.Xml import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named Xml
执行以下操作可修复错误:
>>> import clr
>>> clr.AddReferenceByPartialName('System.Xml')
>>> from System.Xml import *
为什么我必须为某些程序集调用 clr.AddReferenceByPartialName 而对其他程序集却不调用?
【问题讨论】:
标签: .net ironpython