<html>
<head>
<style>
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body class='hmmessage'>
Hello IronPythoners,<BR>
&nbsp;<BR>
I am using the IronPython 2 Beta 1 on .Net 2.0.<BR>
&nbsp;<BR>
My goal is to create a restricted sandbox for scripts to run in using the DLR. I have searched high and low and have not found a solution utilizing the latest python beta release and DLR.&nbsp;It would seem this is something that should be straightforward to accomplish as the DLR's ScriptRuntime.Create takes an AppDomain as an overload. And indeed, my Python engine and runtime are loaded in the remote AppDomain, however I can only get it to work when the AppDomain has FullTrust permissions. Anything lower (say Intranet Zone and the like)&nbsp;and it throws a Method Access Exceptions on the ScriptRuntime.Create method.<BR>
&nbsp;<BR>
I have tried creating the AppDomain like so:<BR><FONT size=2>
AppDomain.CreateDomain(name, defaultEvidence, appDomainSetup, defaultPermissions, TrustedAssemblies.ToArray)<BR>
&nbsp;<BR>
Where:<BR>
name is the name<BR>
defaultEvidence is the evidence for the restricted zone<BR>
appDomainSetup sets the BaseDirectory<BR>
defaultPermissions is the permission set of the restricted zone<BR>
TrustedAssemblies is a list containing references to "Microsoft.Scripting", "IronPython", "IronPython.Modules"<BR>
&nbsp;<BR>
Using any zone other than MyComputer results in the exception. I am not stuck on getting a permission set from a predefined zone, I have tried creating permissions sets other ways with the same result. Using zones seems easier for illustration.<BR>
&nbsp;<BR>
I need IronPython scripts to be run in a fairly constrained environment. No file&nbsp;IO, no loading assemblies. Basically, just the ability for the user to interact with the Hosting apps object model with some basic .Net library functions like String etc.<BR>
&nbsp;<BR>
Thanks!<BR></FONT><br /><hr />Pack up or back up–use SkyDrive to transfer files or keep extra copies. <a href='hthttp://www.windowslive.com/skydrive/overview.html?ocid=TXT_TAGLM_WL_Refresh_skydrive_packup_042008' target='_new'>Learn how.</a></body>
</html>