[IronPython] Some new bugs with asssembly loading...

Martin Maly Martin.Maly at microsoft.com
Wed Jan 4 01:31:03 CET 2006


Hi Steven,

I am not observing the first and second set of the problems you reported. My assembly has name c.d.e.dll and adding reference to it works just fine. It shows up in the References right away also.

>>> import clr
>>> clr.AddReferenceToFile("D:\\Ip\\IronPython\\c.d.e.dll")
>>> clr.References
(mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, c.d.e, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null)

As for the import, we do have a bug that affects global-level types in the referenced assembly. Types that are enclosed in the namespace can be imported without problems:

>>> import N
>>> N.C.M(1,2)
2

Where the assembly c.d.e.dll was compiled from:

namespace N {
public class C {
    public static int M(int a, int b) {
        return a * b;
    }
}
}

Excluding the namespace N will break if I try to do corresponding:

>>> import C
< Exception here >

Martin


-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Steven Drucker
Sent: Tuesday, January 03, 2006 3:55 PM
To: Discussion of IronPython
Subject: [IronPython] Some new bugs with asssembly loading...

A number of bugs seem to have been introduced with the new assembly loading code:

First off, my assemblies will no longer load if they're named x.y (for instance, I was using an assembly that was named Aforge.Imaging). This will break since the code does a .split('.') to find all the names to load.

Second, the first time that I call AddReferenceToFile doesn't effect the clr.References list at all, but it adds it the second time. See the following snippet.

---------------
C:\SHO\private\sdrucker\vizdiff>ip
IronPython 1.0.2194 (Beta) on .NET 2.0.50727.40 Copyright (c) Microsoft Corporation. All rights reserved.
>>> import clr
>>> clr.References
(mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
>>>
clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma
ging
.Dll')
>>> clr.References
(mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)
>>>
clr.AddReferenceToFile('C:/code/iplab/AForge/Imaging/bin/Debug/AForgeIma
ging
.Dll')
>>> clr.References
(mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, Sy stem, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089, AForgeI maging, Version=2.2.0.27774, Culture=neutral, PublicKeyToken=null)
>>> 
----------------

Third, this breaks when I try to import the file. (No module named
AForgeImaging):

>>> import AForgeImaging
Traceback (most recent call last):
  File , line 0, in input##12
ImportError: No module named AForgeImaging
>>>

Any assistance would be appreciated...
--S


_______________________________________________
users mailing list
users at lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com



More information about the Ironpython-users mailing list