[IronPython] How to bring modules in same scope??

Dino Viehland dinov at exchange.microsoft.com
Mon Nov 27 23:37:41 CET 2006


You are passing the assembly name to AddReference?  You should be able to pass the actual Assembly object you get back from reflection instead.  Then if you import the namespaces in the file you're executing it should use the assembly objects you actually loaded yourself.

From: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Blesson Varghese
Sent: Friday, November 24, 2006 9:11 PM
To: Discussion of IronPython
Subject: Re: [IronPython] How to bring modules in same scope??

I know it will work if I use clr. AddReference..... But my project has to do all this from C# code. Via reflection I load all assemblies from a directory. These are loaded by using the statement clrmodule.AddReference(assembly name).
And then when I get the IronPython Exception stating No moduled named assembly was found.......

Simon Dahlbacka <simon.dahlbacka at gmail.com> wrote:
so what about reading the responses you've got, and skip Reflection and do use clr.AddReference ?
On 11/24/06, Blesson Varghese < blssnvarghese at yahoo.co.in<mailto:blssnvarghese at yahoo.co.in>> wrote:
Hi,

I have loaded a few dll's using Reflection from a particular library. I have used the sys.path.append(directory name) also. I have handled all the exceptions too. Now I want to run some scripts that make use of these assemblies loaded. For this I execute the script file using ExecuteFile. But I understand that though the modules were loaded previously it raises exception stating that no modules. After reading a few documents I understand that the possible problem is that they could have been executed on different module scopes. I am pretty new to IronPython...
Pls suggest a way....

Thanks for all help
________________________________
Find out what India is talking about on - Yahoo! Answers India<http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/>
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW<http://us.rd.yahoo.com/mail/in/messengertagline/*http:/in.messenger.yahoo.com>

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


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




________________________________
Find out what India is talking about on - Yahoo! Answers India<http://us.rd.yahoo.com/mail/in/yanswers/*http:/in.answers.yahoo.com/>
Send FREE SMS to your friend's mobile from Yahoo! Messenger Version 8. Get it NOW<http://us.rd.yahoo.com/mail/in/messengertagline/*http:/in.messenger.yahoo.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20061127/a40ed85a/attachment.html>


More information about the Ironpython-users mailing list