System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly C# (CSharp) Méthode

ExecuteAsAssembly() private méthode

private ExecuteAsAssembly ( ) : int
Résultat int
        internal int ExecuteAsAssembly () {
            Object[] attrs = EntryAssembly.EntryPoint.GetCustomAttributes(typeof(STAThreadAttribute), false);
            if (attrs.Length > 0)
                m_apt = ApartmentState.STA;
            attrs = EntryAssembly.EntryPoint.GetCustomAttributes(typeof(MTAThreadAttribute), false);
            if (attrs.Length > 0)
                if (m_apt == ApartmentState.Unknown)
                    m_apt = ApartmentState.MTA;
                else
                    m_apt = ApartmentState.Unknown;
            return Run(true);
        }
    }

Usage Example

        public virtual ObjectHandle CreateInstance(ActivationContext activationContext, string[] activationCustomData)
        {
            if (activationContext == null)
            {
                throw new ArgumentNullException("activationContext");
            }
            Contract.EndContractBlock();

            if (CmsUtils.CompareIdentities(AppDomain.CurrentDomain.ActivationContext, activationContext))
            {
                ManifestRunner runner = new ManifestRunner(AppDomain.CurrentDomain, activationContext);
                return(new ObjectHandle(runner.ExecuteAsAssembly()));
            }

            AppDomainSetup adSetup = new AppDomainSetup(new ActivationArguments(activationContext, activationCustomData));

            // inherit the calling domain's AppDomain Manager
            AppDomainSetup currentDomainSetup = AppDomain.CurrentDomain.SetupInformation;

            adSetup.AppDomainManagerType     = currentDomainSetup.AppDomainManagerType;
            adSetup.AppDomainManagerAssembly = currentDomainSetup.AppDomainManagerAssembly;

            // we inherit the evidence from the calling domain
            return(CreateInstanceHelper(adSetup));
        }
All Usage Examples Of System.Runtime.Hosting.ManifestRunner::ExecuteAsAssembly