Hey guys,<div><br></div><div>I know this is not IronPython specific, but it is causing pain to embbed IronPython in our product. If someone can help, thanks so much!</div><div><br></div><div>I can repro the problem throwing a TypeErrorException from the restricted appdomain like this:</div>
<div><br></div><div><div>        // starts with standard Internet Zone sandbox permissions</div><div>        var evidence = new Evidence();</div><div>        evidence.AddHostEvidence(new Zone(SecurityZone.Internet));</div>
<div>        var permissionSet = SecurityManager.GetStandardSandbox(evidence);</div><div>        permissionSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted));</div><div><br></div><div>        var setup = new AppDomainSetup();</div>
<div>        setup.ApplicationBase = AppDomain.CurrentDomain.BaseDirectory;</div><div>        setup.ApplicationName = &quot;ConsoleScriptHost&quot;;</div><div><br></div><div>        var domain = AppDomain.CreateDomain(setup.ApplicationName, evidence, setup, permissionSet, null);</div>
<div><br></div><div>        try</div><div>        {</div><div>          domain.DoCallBack(delegate</div><div>          {</div><div>            var x = new IronPython.Runtime.Exceptions.TypeErrorException(&quot;xxx&quot;);</div>
<div>            throw x;</div><div>          });</div><div>        }</div><div>        catch (SecurityException ex)</div><div>        {</div><div>          var m = ex.Message; // why this?</div><div>        }</div></div>
<div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Mon, Mar 19, 2012 at 10:50 AM, Cesar Mello <span dir="ltr">&lt;<a href="mailto:cmello@gmail.com">cmello@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<div><br></div><div>When I try to run something like &#39;None + 2&#39; inside a sandboxed domain, I&#39;m getting the following exception:</div><div><br></div><div>System.Security.SecurityException</div><div>Message: Request failed</div>

<div><br></div><div>Stack trace:</div><div><br></div><div><div> at IronPython.Runtime.Exceptions.TypeErrorException.GetObjectData(SerializationInfo info, StreamingContext context)</div><div>   at System.Runtime.Serialization.ObjectCloneHelper.GetObjectData(Object serObj, String&amp; typeName, String&amp; assemName, String[]&amp; fieldNames, Object[]&amp; fieldValues)</div>

<div><br></div></div><div>Any help is greatly appreciated.</div><div><br></div><div>To help debugging, I thought about adding a command line argument to ipy console for setting up a standard Internet-zone sandbox.</div><div>

<br></div><div>Thank you!</div><div><br></div><div>Best regards</div><span class="HOEnZb"><font color="#888888"><div>Mello</div><div><br></div><div><br></div>
</font></span></blockquote></div><br></div>