// // One time initialization to supply the information needed to initialize the default domain and the // the execution environment. // // Remarks: // This design intentionally restricts you to one ExecutionEnvironment per side-by-side runtime in a process. // Aside from the dubious value of allowing multiple executionEnvironments, there is no good way to // for this scenario: // // typeof(Foo).GetTypeInfo() // // to "lookup" a domain in order to map the RuntimeTypeHandle to a specific ExecutionEnvironment. // public static void InitializeExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment) { ExecutionDomain executionDomain = new ExecutionDomain(executionDomainSetup, executionEnvironment); //@todo: This check has a race window but since this is a private api targeted by the toolchain, perhaps this is not so critical. if (_executionDomain != null) throw new InvalidOperationException(); // Multiple Initializes not allowed. _executionDomain = executionDomain; ReflectionCoreCallbacks reflectionCallbacks = new ReflectionCoreCallbacksImplementation(); ReflectionAugments.Initialize(reflectionCallbacks); return; }
// // One time initialization to supply the information needed to initialize the execution environment. // public static void InitializeExecutionDomain(ReflectionDomainSetup executionDomainSetup, ExecutionEnvironment executionEnvironment) { ExecutionDomain executionDomain = new ExecutionDomain(executionDomainSetup, executionEnvironment); //@todo: This check has a race window but since this is a private api targeted by the toolchain, perhaps this is not so critical. if (s_executionDomain != null) { throw new InvalidOperationException(); // Multiple Initializes not allowed. } s_executionDomain = executionDomain; ReflectionCoreCallbacks reflectionCallbacks = new ReflectionCoreCallbacksImplementation(); ReflectionAugments.Initialize(reflectionCallbacks); return; }