1
votes

I am kind of stuck with Iron Python now. All I want to do is to run an ironpython script from python. In my ironpython script I import a .net assembly called mydll.dll.

I thought of 2 ways to do this. The first one was to use pyc.py and make an exe file from the ironpython script. It did not work (I can't remember what was the error message but I remember wasting considerable time trying).

The second way I thought of recently was simply to call ipy.exe from my python script using subprocess.popen. Unfortunately it comes up with an error about "sandboxing" and "loadFromRemoteSources".

Here is the code that brings the error in my python script:

process = subprocess.Popen(["ipy.exe", "myironpythonscript.py"])

Here is what is in myironpythoncript.py:

from clr import AddReferenceToFile
AddReferenceToFile ('mydll.dll')

Does any one knows what's wrong?

1

1 Answers

1
votes

OK I just figured it out.

It actually works, the thing is you need to add a config file called ipy.exe.config containing the following :

<configuration>
 <runtime>
  <loadFromRemoteSources enabled="true"/>
 </runtime>
</configuration>

see here -> How do I setup configuration when I use command line to build C#/.NET?