[IronPython] Loading a static lib a second time in hosted ironpython

Brian Ashcroft BRIAN.ASHCROFT at asu.edu
Thu Feb 3 17:22:00 CET 2011


It appears that I cannot load any kind of dll into the scripting host.
Here is the code that I use to start the script, maybe I have missed
something here?

 

            ScriptEngine engine;

            ScriptScope scope;

 

            engine = Python.CreateEngine();

            scope = engine.CreateScope();

 

            scope.SetVariable("Console", ctw);

            scope.SetVariable("ScriptingInterface",
TomographicMainForm.GetScriptingInterface ());

            ScriptSource source=null ;

            try

            {

                source = engine.CreateScriptSourceFromString(code,
SourceCodeKind.Statements );

                source.Execute(scope);

            }

 

From: users-bounces at lists.ironpython.com
[mailto:users-bounces at lists.ironpython.com] On Behalf Of Brian Ashcroft
Sent: Thursday, February 03, 2011 9:00 AM
To: users at lists.ironpython.com
Subject: [IronPython] Loading a static lib a second time in hosted
ironpython

 

Hello,

   I have an ironpython instance running within my application.  This
instance is used to control the application.  I have a math dll that I
reference in the hosting application that I would like to be able to use
also in the ironpython scripting.  However, I get error messages when I
try to add the reference.  I have tried the ironpython console (ipy.exe)
in the application directory and the dll loads just fine and is
completely usable, but when I try the following code in the application,
I get an error

 

 

import clr

clr.AddReferenceToFile('MathHelpLib.dll')

from MathHelpLib import *

 

 

 

With the error:

Could not add reference to assembly MathHelpLib

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20110203/c47698fd/attachment.html>


More information about the Ironpython-users mailing list