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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 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 <[EMAIL PROTECTED]> wrote:
so what about reading the responses you've got, and skip Reflection and do use 
clr.AddReference ?
On 11/24/06, Blesson Varghese < [EMAIL PROTECTED]<mailto:[EMAIL PROTECTED]>> 
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@lists.ironpython.com<mailto:users@lists.ironpython.com>
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com


_______________________________________________
users mailing list
users@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>
_______________________________________________
users mailing list
users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to