[IronPython] can't import namespace from assembly

Carolyn Johnston (MSNAR) carolj at microsoft.com
Sat Dec 6 00:02:10 CET 2008


I have a dll that I've built in VS2008, C# (and I even strongly named it): Normalizer.dll. It contains a namespace (StringUtilities) which contains a single class (MaxNormalizer).

I can't import the StringUtilities namespace:

>>> ass = Assembly.Load("Normalizer.dll")
>>> ass
<Assembly Normalizer, Version=1.0.0.0, Culture=neutral, PublicKeyToken=0707cddf2bb66849>
>>> clr.AddReference(ass)
>>> import StringUtilities
Traceback (most recent call last):
  File , line 0, in <stdin>##229
  File , line 0, in __import__##7
ImportError: No module named StringUtilities

However you can see that "ass" does contain the StringUtilities namespace (I've included the listNamespaces code at bottom of this email):

>>> ass.GetTypes()
System.Type[](<System.RuntimeType object at 0x000000000000002E [StringUtilities.MaxNormalizer]>)

I also found a help page from Dino here (http://lists.ironpython.com/pipermail/users-ironpython.com/2007-April/004792.html) that implied StringUtilities ought to be an attribute of the assembly itself, so I tried that too:

>>> ass.StringUtilities
Traceback (most recent call last):
  File , line 0, in <stdin>##231
AttributeError: assembly Normalizer has no type StringUtilities

And then I made one last desperate shot at it:

>>> from Normalizer import StringUtilities
Traceback (most recent call last):
  File , line 0, in <stdin>##232
  File , line 0, in __import__##7
ImportError: No module named Normalizer
>>>

Any clues as to why this namespace can't be imported? I'm stumped.

Thanks,
Carolyn
---
Carolyn Johnston (carolj)
Lead Researcher, Local Search, Virtual Earth
Bldg 116/2276 | MIcrosoft Corporation
425-706-2153


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20081205/3c9eff15/attachment.html>


More information about the Ironpython-users mailing list