Free cookie consent management tool by TermsFeed Policy Generator

Changeset 6538


Ignore:
Timestamp:
07/07/11 15:10:33 (13 years ago)
Author:
gkronber
Message:

#831: removed unnecessary method to load assemblies from byte arrays from SandboxApplicationManager. Minor changes in SandboxManager.

Location:
trunk/sources/HeuristicLab.PluginInfrastructure/3.3
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/SandboxApplicationManager.cs

    r6174 r6538  
    132132    }
    133133
    134     /// <summary>
    135     /// Loads raw assemblies dynamically from a byte array
    136     /// </summary>
    137     /// <param name="assemblies">bytearray of all raw assemblies that should be loaded</param>
    138     internal void LoadAssemblies(IEnumerable<byte[]> assemblies) {
    139       foreach (byte[] asm in assemblies) {
    140         Assembly loadedAsm = Assembly.Load(asm);
    141         RegisterLoadedAssembly(loadedAsm);
    142       }
    143     }
    144 
    145134    // register assembly in the assembly cache for the AssemblyResolveEvent
    146135    private void RegisterLoadedAssembly(Assembly asm) {
  • trunk/sources/HeuristicLab.PluginInfrastructure/3.3/Sandboxing/SandboxManager.cs

    r6487 r6538  
    2525using System.Security.Permissions;
    2626using HeuristicLab.PluginInfrastructure.Manager;
     27using System.IO;
    2728
    2829namespace HeuristicLab.PluginInfrastructure.Sandboxing {
     
    6970      //needed for HeuristicLab.Persistence, see DynamicMethod Constructor (String, Type, array<Type []()>[], Type, Boolean)
    7071      pSet.AddPermission(new SecurityPermission(SecurityPermissionFlag.ControlEvidence));
    71 
    72       ReflectionPermission refPerm = new ReflectionPermission(PermissionState.Unrestricted);
    73       pSet.AddPermission(refPerm);
     72      pSet.AddPermission(new ReflectionPermission(PermissionState.Unrestricted));
    7473
    7574      FileIOPermission ioPerm = new FileIOPermission(PermissionState.None);
    7675      //allow path discovery for system drive, needed by HeuristicLab.Persistence: Serializer.BuildTypeCache() -> Assembly.CodeBase
    77       ioPerm.AddPathList(FileIOPermissionAccess.PathDiscovery, Environment.SystemDirectory.Substring(0, 3));
     76      ioPerm.AddPathList(FileIOPermissionAccess.PathDiscovery, Path.GetPathRoot(Path.GetFullPath(Environment.SystemDirectory)));
    7877      //allow full access to the appdomain's base directory
    7978      ioPerm.AddPathList(FileIOPermissionAccess.AllAccess, applicationBase);
Note: See TracChangeset for help on using the changeset viewer.