I have some IronPython code, and im passing variables to it and want to receive a result from python. I managed to get the result from IronPython when i create an engine in the current domain:
ScriptEngine pyEngine = IronPython.Hosting.Python.CreateEngine()
then i just take the result like that:
var result = this.pyScope.GetVariable("ObiektMS").code_1_1_1("II");
However, I need it sandboxed so im creating an AppDomain with restricted permissions and running the engine in it:
ScriptEngine pyEngine = IronPython.Hosting.Python.CreateEngine(newDomain)
But this time when i try to get the result in the samy way i get
An unhandled exception of type 'System.Runtime.Serialization.SerializationException' occurred in PythonTimeTests.exe
Is it because my "result" variable is in a different domain and the result from ironpython has to be serialized?
Is it possible to create a variable in the new domain? I want my program to do this:
1.Read a dictionary from a file.
2.Create a new domain with restrictions and pass the dictionary to it.
3.Do work in iron python by calling python functions from c#(all in restricted domain)
4.Return the results to the unrestricted domain.