예제 #1
0
        public InterfaceAppDomainProxy(Type appDomainSetupType, bool appDomainSetupTypeLoadFromMainModule = false)
        {
            AppDomain.MonitoringIsEnabled = true;
            AppDomainSetupType            = appDomainSetupType;
            PermissionSet grantSet  = new PermissionSet(PermissionState.Unrestricted);
            AppDomain     appDomain = AppDomain.CreateDomain("Interface", null, new AppDomainSetup
            {
                ApplicationBase = AppDomain.CurrentDomain.SetupInformation.ApplicationBase
            }, grantSet);
            string assemblyFile = System.Diagnostics.Process.GetCurrentProcess()?.MainModule?.FileName;

            if (null != appDomainSetupType)
            {
                if (appDomainSetupTypeLoadFromMainModule && !IsRunningInHostingProcess)
                {
                    appDomain.CreateInstanceFrom(assemblyFile, appDomainSetupType.FullName);
                }
                else
                {
                    appDomain.CreateInstance(appDomainSetupType.Assembly.FullName, appDomainSetupType.FullName);
                }
            }
            Type typeFromHandle = typeof(AppDomainProxyByte);

            InterfaceAppDomainSetup.Setup();
            Proxy = (AppDomainProxyByte)appDomain.CreateInstanceAndUnwrap(typeFromHandle.Assembly.FullName, typeFromHandle.FullName);
            InterfaceAppDomain = appDomain;
        }
예제 #2
0
 public AppDomainProxyByte()
 {
     StaticProxy = this;
     AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
     AppDomain.CurrentDomain.AssemblyResolve    += CurrentDomain_AssemblyResolve;
 }
예제 #3
0
 public object FüüreAus()
 {
     return(AppDomainProxyByte.InterfaceKomponenteKonstrukt(AssemblyName, TypeName, args, KonstruktWenBeraitsVorhande));
 }