[IronPython] clr.AddRefernce* woes

Dino Viehland dinov at exchange.microsoft.com
Fri Feb 24 03:07:32 CET 2006


There were a couple of bugs w/ assembly loading in beta 3.  

As a work around you should be able to do:

import System
clr.AddReference(System.Reflection.Assembly.Load('System.Xml'))

clr.AddReference(System.Reflection.Assembly.LoadFrom('System.Xml'))

clr.AddReference(System.Reflection.Assembly.LoadWithPartialName('System.Xml'))


Obviously we'll have it fixed in beta 4.


Do you want to help develop Dynamic languages on CLR? (http://members.microsoft.com/careers/search/details.aspx?JobID=6D4754DE-11F0-45DF-8B78-DC1B43134038)

-----Original Message-----
From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Dan Shechter
Sent: Thursday, February 23, 2006 4:19 PM
To: users at lists.ironpython.com
Subject: [IronPython] clr.AddRefernce* woes

Hi,
I've just installed beta 3 drop but I can't use clr.AddReference to anything
that isn't part of .NET 2.0 core libraries.
I'm trying to load a .NET 2.0 compiled assembly. "PERWAPI.dll", I have a
test.exe console c# program
which does invoke methods and instantiate classes defined within that DLL.
I'm also having problems with the tutorial "demo" using mapack.dll., I've
provided a transcript below:
---------------------------------------- CUT HERE
----------------------------
>>> import clr
>>> clr.AddReference("System.XML")
- Crashed

>>> import clr
>>> clr.AddReferenceByPartialName("System.XML")
- works

>>> clr.AddReferenceByPartialName("Mapack")
Traceback (most recent call last):
  File , line 0, in input##152
  File , line 0, in AddReferenceByPartialName##81
RuntimeError: Could not add reference to assembly Mapack

>>> clr.Path
[]

>>> clr.Path.append(System.Environment.CurrentDirectory)

>>> clr.Path
['C:\\Development\\IronPython\\Tutorial']

>>> clr.AddReferenceByPartialName("Mapack")
 - Crashed
---------------------------------------- CUT HERE
----------------------------

Naturally the same happens for PERWAPI.dll (which I'm really interested in
getting to work) and naturally,
Both .DLLs (PERWAPI.DLL & MAPACK.DLL) are in the '
C:\Development\IronPython\Tutorial'' on my machine...

Any ideas?



_______________________________________________
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