public override AppDomain CreateAppDomainWithPolicy(string appDomainName, Evidence evidence, AppDomainSetup setupInfo, SandboxCasPolicySettings casSettings)
 {
     return(AppDomain.CurrentDomain);
 }
Пример #2
0
        public override AssemblyLoadContext CreateAssemblyLoadContextWithPolicy(string appDomainName, Evidence evidence, AppDomainSetup setupInfo, SandboxCasPolicySettings casSettings)
        {
            AssemblyLoadContext assemblyLoadContext = new AssemblyLoadContext(appDomainName, true);

            return(assemblyLoadContext);
        }
Пример #3
0
 internal ReportRuntimeSetupHandler()
 {
     m_executeInSandbox            = TriState.Unknown;
     m_isAppDomainCasPolicyEnabled = TriState.Unknown;
     m_sandboxCasSettings          = new SandboxCasPolicySettings();
 }
Пример #4
0
        public override AppDomain CreateAppDomainWithPolicy(string appDomainName, Evidence evidence, SandboxCasPolicySettings casSettings)
        {
            PermissionSet permissionSet = casSettings.BasePermissions;

            if (permissionSet == null)
            {
                permissionSet = new PermissionSet(PermissionState.None);
                permissionSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.Execution));
            }
            StrongName[] baseFullTrustAssemblies = ControlPolicyManager.GetBaseFullTrustAssemblies();
            int          num = baseFullTrustAssemblies.Length;

            if (casSettings.FullTrustAssemblies != null)
            {
                num += casSettings.FullTrustAssemblies.Count;
            }
            StrongName[] array = new StrongName[num];
            Array.Copy(baseFullTrustAssemblies, array, baseFullTrustAssemblies.Length);
            if (casSettings.FullTrustAssemblies != null)
            {
                casSettings.FullTrustAssemblies.CopyTo(array, baseFullTrustAssemblies.Length);
            }
            return(AppDomain.CreateDomain(appDomainName));
        }