I have something like the following code:

ScriptEngine engine = Python.CreateEngine();
ScriptScope scope = engine.CreateScope();

engine.Runtime.LoadAssembly(Assembly.GetExecutingAssembly()); // holds
the namespace foo

// the following line throws an exception
engine.Runtime.ImportModule("foo");

// the following if executed works fine
engine.Execute("import foo");


I'm basically just trying to make the types in my executing assembly
available to the script. I assumed that the ImportModule would see
things that had been loaded using LoadAssembly, but this doesn't seem
to be the case.

Does anyone have examples of doing this that works?

Thanks,

slide
_______________________________________________
Users mailing list
Users@lists.ironpython.com
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to