Exemple #1
0
        [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
        public static Assembly Load(string assemblyString)
        {
            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;

            return(RuntimeAssembly.InternalLoad(assemblyString, ref stackMark, AssemblyLoadContext.CurrentContextualReflectionContext));
        }
        public static Assembly ReflectionOnlyLoad(string assemblyString)
        {
            StackCrawlMark lookForMyCaller = StackCrawlMark.LookForMyCaller;

            return(RuntimeAssembly.InternalLoad(assemblyString, null, ref lookForMyCaller, true));
        }
        [System.Security.DynamicSecurityMethod] // Methods containing StackCrawlMark local var has to be marked DynamicSecurityMethod
        public static Assembly Load(string assemblyString)
        {
            StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller;

            return(RuntimeAssembly.InternalLoad(assemblyString, ref stackMark));
        }
        public static Assembly Load(string assemblyString, System.Security.Policy.Evidence assemblySecurity)
        {
            StackCrawlMark lookForMyCaller = StackCrawlMark.LookForMyCaller;

            return(RuntimeAssembly.InternalLoad(assemblyString, assemblySecurity, ref lookForMyCaller, false));
        }