Loading additional .NET libraries problem

May 23, 2010 at 2:04 PM
I want to use my .NET library in IronPython. As follows:

>>>import clr
>>>clr.AddReferenceToFile("Animate.NET.dll")
>>>from Animate.NET import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named NET

But there is no problem when I use "Mapack.dll"

>>>import clr
>>>clr.AddReferenceToFile("Mapack.dll")
>>>from Mapack import *

You can download Mapack from here (direct link to the Mapack.zip download is here). And you can download Animate.NET.dll and the source code(AnimateSamples.7z) from here

Thanks,
-zeyoo
May 23, 2010 at 2:09 PM

The IronPython import statement needs namespace names, not assembly names. You should be able to get the names of the namespaces in Animate.NET.dll from its documentation. If not, you could use a tool like Reflector or ILDASM to inspect the dll and see which namespaces are inside of it.

May 23, 2010 at 2:26 PM
Hi CurtHagenlocher,

Can you download the code from here? Tell me there is any problem, please! Thank you!

-zeyoo
Coordinator
May 23, 2010 at 6:00 PM

The 1 namespace is Animate.NET.dll is “Animator” so that’s what you need to import.  There are some other top level classes as well – you can see those yourself using ildasm or Reflector as Curt mentioned.  You can also do clr.LoadAssemblyFromFile(…) and use dir to inspect the assembly.

From: zeyoo [mailto:notifications@codeplex.com]
Sent: Sunday, May 23, 2010 7:27 AM
To: Dino Viehland
Subject: Re: Loading additional .NET libraries problem [dlr:213566]

From: zeyoo

Hi CurtHagenlocher,

Can you download the code from here? Tell me there is any problem, please! Thank you!

-zeyoo

Read the full discussion online.

To add a post to this discussion, reply to this email (dlr@discussions.codeplex.com)

To start a new discussion for this project, email dlr@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com