internal void SetupFusionContext(IntPtr fusionContext, AppDomainSetup oldADS)
        {
            this.UpdateContextPropertyIfNeeded(LoaderInformation.ApplicationBaseValue, ApplicationBaseKey, null, fusionContext, oldADS);
            this.UpdateContextPropertyIfNeeded(LoaderInformation.PrivateBinPathValue, PrivateBinPathKey, null, fusionContext, oldADS);
            this.UpdateContextPropertyIfNeeded(LoaderInformation.DevPathValue, DeveloperPathKey, null, fusionContext, oldADS);
            this.UpdateBooleanContextPropertyIfNeeded(LoaderInformation.DisallowPublisherPolicyValue, DisallowPublisherPolicyKey, fusionContext, oldADS);
            this.UpdateBooleanContextPropertyIfNeeded(LoaderInformation.DisallowCodeDownloadValue, DisallowCodeDownloadKey, fusionContext, oldADS);
            this.UpdateBooleanContextPropertyIfNeeded(LoaderInformation.DisallowBindingRedirectsValue, DisallowBindingRedirectsKey, fusionContext, oldADS);
            this.UpdateBooleanContextPropertyIfNeeded(LoaderInformation.DisallowAppBaseProbingValue, DisallowAppBaseProbingKey, fusionContext, oldADS);
            if (this.UpdateContextPropertyIfNeeded(LoaderInformation.ShadowCopyFilesValue, ShadowCopyFilesKey, this.ShadowCopyFiles, fusionContext, oldADS))
            {
                if (this.Value[7] == null)
                {
                    this.ShadowCopyDirectories = this.BuildShadowCopyDirectories();
                }
                this.UpdateContextPropertyIfNeeded(LoaderInformation.ShadowCopyDirectoriesValue, ShadowCopyDirectoriesKey, null, fusionContext, oldADS);
            }
            this.UpdateContextPropertyIfNeeded(LoaderInformation.CachePathValue, CachePathKey, null, fusionContext, oldADS);
            this.UpdateContextPropertyIfNeeded(LoaderInformation.PrivateBinPathProbeValue, PrivateBinPathProbeKey, this.PrivateBinPathProbe, fusionContext, oldADS);
            this.UpdateContextPropertyIfNeeded(LoaderInformation.ConfigurationFileValue, ConfigurationFileKey, null, fusionContext, oldADS);
            UpdateByteArrayContextPropertyIfNeeded(this._ConfigurationBytes, (oldADS == null) ? null : oldADS.GetConfigurationBytes(), ConfigurationBytesKey, fusionContext);
            this.UpdateContextPropertyIfNeeded(LoaderInformation.ApplicationNameValue, ApplicationNameKey, this.ApplicationName, fusionContext, oldADS);
            this.UpdateContextPropertyIfNeeded(LoaderInformation.DynamicBaseValue, DynamicBaseKey, null, fusionContext, oldADS);
            StringBuilder builder = new StringBuilder();

            builder.Append(RuntimeEnvironment.GetRuntimeDirectoryImpl());
            builder.Append(RuntimeConfigurationFile);
            UpdateContextProperty(fusionContext, MachineConfigKey, builder.ToString());
            string hostBindingFile = RuntimeEnvironment.GetHostBindingFile();

            if ((hostBindingFile != null) || (oldADS != null))
            {
                UpdateContextProperty(fusionContext, HostBindingKey, hostBindingFile);
            }
        }
Esempio n. 2
0
        internal void SetupFusionContext(IntPtr fusionContext)
        {
            String appbase = Value[(int)LoaderInformation.ApplicationBaseValue];

            if (appbase != null)
            {
                UpdateContextProperty(fusionContext, ApplicationBaseKey, appbase);
            }

            if (PrivateBinPath != null)
            {
                UpdateContextProperty(fusionContext, PrivateBinPathKey, PrivateBinPath);
            }

            if (DeveloperPath != null)
            {
                UpdateContextProperty(fusionContext, DeveloperPathKey, DeveloperPath);
            }

            if (DisallowPublisherPolicy)
            {
                UpdateContextProperty(fusionContext, DisallowPublisherPolicyKey, "true");
            }

            if (ShadowCopyFiles != null)
            {
                UpdateContextProperty(fusionContext, ShadowCopyFilesKey, ShadowCopyFiles);

                // If we are asking for shadow copy directories then default to
                // only to the ones that are in the private bin path.
                if (Value[(int)LoaderInformation.ShadowCopyDirectoriesValue] == null)
                {
                    ShadowCopyDirectories = BuildShadowCopyDirectories();
                }

                String shadowDirs = Value[(int)LoaderInformation.ShadowCopyDirectoriesValue];
                if (shadowDirs != null)
                {
                    UpdateContextProperty(fusionContext, ShadowCopyDirectoriesKey, shadowDirs);
                }
            }

            String cache = Value[(int)LoaderInformation.CachePathValue];

            if (cache != null)
            {
                UpdateContextProperty(fusionContext, CachePathKey, cache);
            }

            if (PrivateBinPathProbe != null)
            {
                UpdateContextProperty(fusionContext, PrivateBinPathProbeKey, PrivateBinPathProbe);
            }

            String config = Value[(int)LoaderInformation.ConfigurationFileValue];

            if (config != null)
            {
                UpdateContextProperty(fusionContext, ConfigurationFileKey, config);
            }

            if (ApplicationName != null)
            {
                UpdateContextProperty(fusionContext, ApplicationNameKey, ApplicationName);
            }

            String dynbase = Value[(int)LoaderInformation.DynamicBaseValue];

            if (dynbase != null)
            {
                UpdateContextProperty(fusionContext, DynamicBaseKey, dynbase);
            }

            // Always add the runtime configuration file to the appdomain
            StringBuilder configFile = new StringBuilder();

            configFile.Append(RuntimeEnvironment.GetRuntimeDirectoryImpl());
            configFile.Append(RuntimeConfigurationFile);
            UpdateContextProperty(fusionContext, MachineConfigKey, configFile.ToString());

            String hostBindingFile = RuntimeEnvironment.GetHostBindingFile();

            if (hostBindingFile != null)
            {
                UpdateContextProperty(fusionContext, HostBindingKey, hostBindingFile);
            }
        }
Esempio n. 3
0
        internal void SetupFusionContext(IntPtr fusionContext)
        {
            string str = this.Value[0];

            if (str != null)
            {
                UpdateContextProperty(fusionContext, ApplicationBaseKey, str);
            }
            string str2 = this.Value[5];

            if (str2 != null)
            {
                UpdateContextProperty(fusionContext, PrivateBinPathKey, str2);
            }
            string str3 = this.Value[3];

            if (str3 != null)
            {
                UpdateContextProperty(fusionContext, DeveloperPathKey, str3);
            }
            if (this.DisallowPublisherPolicy)
            {
                UpdateContextProperty(fusionContext, DisallowPublisherPolicyKey, "true");
            }
            if (this.DisallowCodeDownload)
            {
                UpdateContextProperty(fusionContext, DisallowCodeDownloadKey, "true");
            }
            if (this.DisallowBindingRedirects)
            {
                UpdateContextProperty(fusionContext, DisallowBindingRedirectsKey, "true");
            }
            if (this.DisallowApplicationBaseProbing)
            {
                UpdateContextProperty(fusionContext, DisallowAppBaseProbingKey, "true");
            }
            if (this.ShadowCopyFiles != null)
            {
                UpdateContextProperty(fusionContext, ShadowCopyFilesKey, this.ShadowCopyFiles);
                if (this.Value[7] == null)
                {
                    this.ShadowCopyDirectories = this.BuildShadowCopyDirectories();
                }
                string str4 = this.Value[7];
                if (str4 != null)
                {
                    UpdateContextProperty(fusionContext, ShadowCopyDirectoriesKey, str4);
                }
            }
            string str5 = this.Value[9];

            if (str5 != null)
            {
                UpdateContextProperty(fusionContext, CachePathKey, str5);
            }
            if (this.PrivateBinPathProbe != null)
            {
                UpdateContextProperty(fusionContext, PrivateBinPathProbeKey, this.PrivateBinPathProbe);
            }
            string str6 = this.Value[1];

            if (str6 != null)
            {
                UpdateContextProperty(fusionContext, ConfigurationFileKey, str6);
            }
            if (this._ConfigurationBytes != null)
            {
                UpdateContextProperty(fusionContext, ConfigurationBytesKey, this._ConfigurationBytes);
            }
            if (this.ApplicationName != null)
            {
                UpdateContextProperty(fusionContext, ApplicationNameKey, this.ApplicationName);
            }
            string str7 = this.Value[2];

            if (str7 != null)
            {
                UpdateContextProperty(fusionContext, DynamicBaseKey, str7);
            }
            StringBuilder builder = new StringBuilder();

            builder.Append(RuntimeEnvironment.GetRuntimeDirectoryImpl());
            builder.Append(RuntimeConfigurationFile);
            UpdateContextProperty(fusionContext, MachineConfigKey, builder.ToString());
            string hostBindingFile = RuntimeEnvironment.GetHostBindingFile();

            if (hostBindingFile != null)
            {
                UpdateContextProperty(fusionContext, HostBindingKey, hostBindingFile);
            }
        }