[IronPython] wierd import problem

Tony Djordjevski tony at v-sim.com
Mon Apr 23 21:35:53 CEST 2007

Hi everyone,

I'm seeing a bit of weirdness when trying to import a dll with a nested 
namespace.  Actually, I'm not sure if it's a filename issue or a 
namespace issue, as the filename of the assembly is named after the 

OK, let's say I have two assemblies: Foo.exe and Foo.Bar.dll (I've 
attached a simple Visual Studio project to recreate the situation)

I want to "import Foo.Bar", but I'm getting an error concerning Foo.exe

Here's the steps to reproduce:

 >>> import clr
 >>> clr.AddReferenceToFile('Foo.Bar.dll')
 >>> import Foo.Bar
Traceback (most recent call last):
   File , line 0, in <stdin>##14
   File , line 0, in __import__##7
SystemError: C:\Temp\Foo\bin\Debug\Foo.exe is not pre-compiled module; 
try again after deleting it.
 >>> for ref in clr.References:
...     print ref
mscorlib, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089
System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089
Foo.Bar, Version=, Culture=neutral, PublicKeyToken=null

As the output shows, Foo.Bar has been referenced.  So what am I doing 
wrong that I can't import?

BTW, I'm using IP v1.1 (in case you're wondering).


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Foo.zip
Type: application/zip
Size: 5011 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20070423/b4d7fc68/attachment.zip>

More information about the Ironpython-users mailing list