// Token: 0x06001180 RID: 4480 RVA: 0x00054558 File Offset: 0x00052758
        internal static OrganizationId FindOneSharedConfigurationId(SharedConfigurationInfo sci, PartitionId partitionId)
        {
            ExchangeConfigurationUnit exchangeConfigurationUnit = SharedConfiguration.FindOneSharedConfiguration(sci, partitionId);

            if (exchangeConfigurationUnit == null)
            {
                return(null);
            }
            return(exchangeConfigurationUnit.OrganizationId);
        }
        protected override void InternalProcessRecord()
        {
            TaskLogger.LogEnter();
            bool advancedHydrateableObjectsSharedEnabled = this.newServicePlanSettings.Organization.AdvancedHydrateableObjectsSharedEnabled;

            base.InternalCreateSharedConfiguration = (this.oldServicePlanSettings.Organization.ShareableConfigurationEnabled && this.newServicePlanSettings.Organization.ShareableConfigurationEnabled && this.tenantCU.SupportedSharedConfigurations.Count == 0);
            base.InternalIsSharedConfigServicePlan = this.config.IsSharedConfigurationAllowedForServicePlan(this.newServicePlanSettings);
            this.monadConnection.RunspaceProxy.SetVariable("TargetServicePlan", this.newServicePlan);
            this.monadConnection.RunspaceProxy.SetVariable("TargetProgramId", this.targetProgramId);
            this.monadConnection.RunspaceProxy.SetVariable("TargetOfferId", this.targetOfferId);
            if (this.tenantCU.ServicePlan == this.newServicePlan)
            {
                base.WriteVerbose(Strings.VerboseWillSkipUpdateServicePlan(this.Identity.ToString()));
            }
            else if (!ServicePlan.CompareAndCalculateDelta(this.oldServicePlanSettings, this.newServicePlanSettings, this.IsCrossSKUMigration, out this.deltaServicePlanSettings, out this.featuresToApply))
            {
                base.WriteVerbose(Strings.VerboseWillUpgradeServicePlan(this.Identity.ToString(), this.tenantCU.ServicePlan, this.newServicePlan));
                if (advancedHydrateableObjectsSharedEnabled)
                {
                    string text;
                    if (!this.config.TryGetHydratedOfferId(this.targetProgramId, this.targetOfferId, out text))
                    {
                        text = this.targetOfferId;
                    }
                    SharedConfigurationInfo sharedConfigurationInfo = SharedConfigurationInfo.FromInstalledVersion(this.targetProgramId, text);
                    OrganizationId          organizationId          = SharedConfiguration.FindOneSharedConfigurationId(sharedConfigurationInfo, this.tenantCU.OrganizationId.PartitionId);
                    if (organizationId == null)
                    {
                        base.WriteError(new SharedConfigurationValidationException(Strings.ErrorSharedConfigurationNotFound(this.targetProgramId, text, sharedConfigurationInfo.CurrentVersion.ToString())), (ErrorCategory)1000, null);
                    }
                    else
                    {
                        this.monadConnection.RunspaceProxy.SetVariable("TargetSharedConfiguration", organizationId.OrganizationalUnit.Name);
                    }
                }
                if (ManageServicePlanMigrationBase.MailboxPlanConfigurationChanged(this.deltaServicePlanSettings))
                {
                    ManageServicePlanMigrationBase.CopyEnabledMailboxPlanRoleAssignmentFeatures(this.deltaServicePlanSettings, this.newServicePlanSettings);
                }
                this.newServicePlanSettings.Name = "new";
                base.InternalProcessRecord();
                if (this.configOnly)
                {
                    this.WriteWarning(Strings.WarningUpgradeIsNotComplete(this.UpgradePhase.ToString()));
                }
            }
            else
            {
                base.WriteVerbose(Strings.VerboseWillSkipUpdateServicePlan(this.Identity.ToString()));
            }
            TaskLogger.LogExit();
        }
Ejemplo n.º 3
0
        private static bool ShouldCreateSharedConfiguration(string programId, string offerId, PartitionId partitionId, out ExchangeConfigurationUnit sctConfigUnit)
        {
            sctConfigUnit = null;
            ADDriverContext processADContext = ADSessionSettings.GetProcessADContext();

            if (processADContext == null || processADContext.Mode != ContextMode.Setup)
            {
                return(true);
            }
            SharedConfigurationInfo sci = SharedConfigurationInfo.FromInstalledVersion(programId, offerId);

            sctConfigUnit = SharedConfiguration.FindOneSharedConfiguration(sci, partitionId);
            return(sctConfigUnit == null);
        }
        // Token: 0x06001183 RID: 4483 RVA: 0x00054608 File Offset: 0x00052808
        internal static string CreateSharedConfigurationName(string programId, string offerId)
        {
            SharedConfigurationInfo sharedConfigurationInfo = SharedConfigurationInfo.FromInstalledVersion(programId, offerId);
            string text = string.Format("{0}{1}{2}_{3}", new object[]
            {
                SharedConfiguration.SCTNamePrefix,
                "-",
                sharedConfigurationInfo.ToString().ToLower().Replace("_hydrated", null),
                Guid.NewGuid().ToString().Substring(0, 5)
            });

            if (text.Length > SharedConfiguration.SctNameMaxLength)
            {
                text = text.Substring(0, SharedConfiguration.SctNameMaxLength);
            }
            return(text);
        }
        // Token: 0x0600117F RID: 4479 RVA: 0x000544FC File Offset: 0x000526FC
        internal static ExchangeConfigurationUnit FindOneSharedConfiguration(SharedConfigurationInfo sci, PartitionId partitionId)
        {
            ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromAllTenantsPartitionId(partitionId), 657, "FindOneSharedConfiguration", "f:\\15.00.1497\\sources\\dev\\data\\src\\directory\\SharedConfiguration.cs");

            ExchangeConfigurationUnit[] array = tenantConfigurationSession.FindSharedConfiguration(sci, true);
            if (array == null || array.Length == 0)
            {
                return(null);
            }
            if (array.Length == 1)
            {
                return(array[0]);
            }
            Random random = new Random();

            return(array[random.Next(array.Length)]);
        }
        // Token: 0x06001182 RID: 4482 RVA: 0x0005459C File Offset: 0x0005279C
        internal static OrganizationId FindMostRecentSharedConfigurationInPartition(OrganizationId sourceOrganizationId, PartitionId targetAccountPartitionId, out Exception ex)
        {
            ex = null;
            OrganizationId organizationId = null;

            ExchangeConfigurationUnit[] array = SharedConfiguration.LoadSharedConfigurationsSorted(sourceOrganizationId);
            if (array != null && array.Length > 0)
            {
                int num = array.Length;
                SharedConfigurationInfo sharedConfigurationInfo = array[num - 1].SharedConfigurationInfo;
                organizationId = SharedConfiguration.FindOneSharedConfigurationId(sharedConfigurationInfo, targetAccountPartitionId);
                if (organizationId == null)
                {
                    ex = new InvalidOperationException(DirectoryStrings.ErrorTargetPartitionSctMissing(sourceOrganizationId.ConfigurationUnit.DistinguishedName, targetAccountPartitionId.ForestFQDN, sharedConfigurationInfo.ToString()));
                }
            }
            return(organizationId);
        }
        internal static string CreateSharedConfigurationName(string programId, string offerId)
        {
            SharedConfigurationInfo sharedConfigurationInfo = SharedConfigurationInfo.FromInstalledVersion(programId, offerId);
            string text = string.Format("{0}{1}{2}{3}{4}", new object[]
            {
                SharedConfiguration.SCTNamePrefix,
                TemplateTenantConfiguration.Separator,
                sharedConfigurationInfo.ToString().ToLower().Replace("_", "-"),
                TemplateTenantConfiguration.Separator,
                Guid.NewGuid().ToString().Substring(0, 5)
            });

            if (text.Length > TemplateTenantConfiguration.maxStubLength)
            {
                text = text.Substring(0, TemplateTenantConfiguration.maxStubLength);
            }
            return(text + TemplateTenantConfiguration.TopLevelDomain);
        }
Ejemplo n.º 8
0
        protected override IConfigurable PrepareDataObject()
        {
            IConfigurationSession configurationSession = base.DataSession as IConfigurationSession;
            bool useConfigNC = configurationSession.UseConfigNC;

            configurationSession.UseConfigNC = false;
            try
            {
                this.ou = (ADOrganizationalUnit)base.GetDataObject <ADOrganizationalUnit>(this.OrganizationalUnit, configurationSession, null, new LocalizedString?(Strings.ErrorOrganizationalUnitNotFound(this.OrganizationalUnit.ToString())), new LocalizedString?(Strings.ErrorOrganizationalUnitNotUnique(this.OrganizationalUnit.ToString())));
                this.ouOriginatingServer = this.ou.OriginatingServer;
            }
            finally
            {
                configurationSession.UseConfigNC = useConfigNC;
            }
            ExchangeConfigurationUnit     exchangeConfigurationUnit    = (ExchangeConfigurationUnit)base.PrepareDataObject();
            ITopologyConfigurationSession topologyConfigurationSession = DirectorySessionFactory.Default.CreateTopologyConfigurationSession(ConsistencyMode.IgnoreInvalid, ADSessionSettings.FromRootOrgScopeSet(), 290, "PrepareDataObject", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\DirectorySetup\\InstallTenantConfigurationContainerTask.cs");
            string parentLegacyDN = string.Format(CultureInfo.InvariantCulture, "{0}{1}", new object[]
            {
                topologyConfigurationSession.GetAdministrativeGroup().LegacyExchangeDN,
                this.GetRelativeDNTillConfigurationUnits(exchangeConfigurationUnit.Id)
            });

            exchangeConfigurationUnit.Name               = exchangeConfigurationUnit.Id.Rdn.UnescapedName;
            exchangeConfigurationUnit.LegacyExchangeDN   = LegacyDN.GenerateLegacyDN(parentLegacyDN, exchangeConfigurationUnit);
            exchangeConfigurationUnit.OrganizationStatus = OrganizationStatus.PendingCompletion;
            if (!string.IsNullOrEmpty(this.ServicePlan))
            {
                exchangeConfigurationUnit.ServicePlan = this.ServicePlan;
            }
            if (!string.IsNullOrEmpty(this.ProgramId) && !string.IsNullOrEmpty(this.OfferId))
            {
                exchangeConfigurationUnit.ResellerId = string.Format("{0}.{1}", this.ProgramId, this.OfferId);
                if (this.CreateSharedConfiguration)
                {
                    this.DataObject.SharedConfigurationInfo = SharedConfigurationInfo.FromInstalledVersion(this.ProgramId, this.OfferId);
                }
            }
            if (string.IsNullOrEmpty(exchangeConfigurationUnit.ExternalDirectoryOrganizationId))
            {
                exchangeConfigurationUnit.ExternalDirectoryOrganizationId = Guid.NewGuid().ToString();
            }
            return(exchangeConfigurationUnit);
        }
        public ExchangeConfigurationUnit[] FindSharedConfiguration(SharedConfigurationInfo sharedConfigInfo, bool enabledSharedOrgOnly)
        {
            if (!base.SessionSettings.IsGlobal && base.ConfigScope != ConfigScopes.AllTenants)
            {
                throw new NotSupportedException("FindEnabledSharedConfiguration cannot be invoked on non Global sessions");
            }
            if (sharedConfigInfo == null)
            {
                throw new ArgumentNullException("sharedConfigInfo");
            }
            QueryFilter filter = new AndFilter(new QueryFilter[]
            {
                new ComparisonFilter(ComparisonOperator.Equal, OrganizationSchema.SharedConfigurationInfo, sharedConfigInfo),
                new ComparisonFilter(ComparisonOperator.Equal, ExchangeConfigurationUnitSchema.OrganizationStatus, OrganizationStatus.Active),
                new ComparisonFilter(ComparisonOperator.Equal, OrganizationSchema.ImmutableConfiguration, true),
                new ComparisonFilter(ComparisonOperator.Equal, OrganizationSchema.EnableAsSharedConfiguration, enabledSharedOrgOnly)
            });

            return(base.Find <ExchangeConfigurationUnit>(null, QueryScope.SubTree, filter, null, 0));
        }
        // Token: 0x06001181 RID: 4481 RVA: 0x00054578 File Offset: 0x00052778
        internal static bool DoesSctExistForVersion(ServerVersion version, string programId, string offerId, PartitionId partitionId)
        {
            SharedConfigurationInfo sci = new SharedConfigurationInfo(version, programId, offerId);

            return(SharedConfiguration.FindOneSharedConfigurationId(sci, partitionId) != null);
        }
        protected override void InternalValidate()
        {
            TaskLogger.LogEnter();
            base.InternalValidate();
            Exception ex = null;

            try
            {
                if (string.IsNullOrEmpty(this.tenantCU.ServicePlan))
                {
                    base.WriteError(new InvalidOperationException(Strings.ErrorServicePlanIsNotSet), (ErrorCategory)1002, null);
                }
                if (ServicePlanConfiguration.IsDeprecatedServicePlan(this.tenantCU.ServicePlan))
                {
                    base.WriteError(new InvalidOperationException(Strings.ErrorServicePlanIsDeprecated(this.tenantCU.Name, this.tenantCU.ServicePlan, this.tenantCU.ProgramId)), (ErrorCategory)1002, null);
                }
                this.servicePlanSettings = ServicePlanConfiguration.GetInstance().GetServicePlanSettings(this.tenantCU.ServicePlan);
                base.InternalLocalStaticConfigEnabled      = !this.servicePlanSettings.Organization.AdvancedHydrateableObjectsSharedEnabled;
                base.InternalLocalHydrateableConfigEnabled = !this.servicePlanSettings.Organization.CommonHydrateableObjectsSharedEnabled;
            }
            catch (ArgumentException ex2)
            {
                ex = ex2;
            }
            catch (IOException ex3)
            {
                ex = ex3;
            }
            if (ex != null)
            {
                base.WriteError(ex, (ErrorCategory)1000, null);
            }
            if (!string.IsNullOrEmpty(this.tenantCU.TargetServicePlan))
            {
                string value = ServicePlanConfiguration.GetInstance().ResolveServicePlanName(this.tenantCU.ProgramId, this.TargetOfferId);
                if (!this.tenantCU.TargetServicePlan.Equals(value, StringComparison.OrdinalIgnoreCase))
                {
                    base.WriteError(new InvalidOperationException(Strings.ErrorOOBUpgradeInProgress(this.tenantCU.ServicePlan, this.tenantCU.TargetServicePlan)), (ErrorCategory)1002, null);
                }
            }
            base.InternalIsSharedConfigServicePlan = ServicePlanConfiguration.GetInstance().IsSharedConfigurationAllowedForServicePlan(this.tenantCU.ProgramId, this.tenantCU.OfferId);
            if (base.InternalIsSharedConfigServicePlan)
            {
                if (this.tenantCU.SharedConfigurationInfo == null)
                {
                    ITenantConfigurationSession          tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(false, ConsistencyMode.PartiallyConsistent, ADSessionSettings.FromAllTenantsObjectId(this.tenantCU.Id), 210, "InternalValidate", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Deployment\\StartOrganizationUpgradeTask.cs");
                    Result <ExchangeConfigurationUnit>[] array = tenantConfigurationSession.ReadMultiple <ExchangeConfigurationUnit>(this.tenantCU.SupportedSharedConfigurations.ToArray());
                    string offerId;
                    if (!ServicePlanConfiguration.GetInstance().TryGetHydratedOfferId(this.tenantCU.ProgramId, this.tenantCU.OfferId, out offerId))
                    {
                        offerId = this.tenantCU.OfferId;
                    }
                    SharedConfigurationInfo sharedConfigurationInfo = SharedConfigurationInfo.FromInstalledVersion(this.tenantCU.ProgramId, offerId);
                    foreach (Result <ExchangeConfigurationUnit> result in array)
                    {
                        if (result.Data != null)
                        {
                            ExchangeConfigurationUnit data = result.Data;
                            if (data.SharedConfigurationInfo.Equals(sharedConfigurationInfo))
                            {
                                base.InternalSharedConfigurationId = data.OrganizationId;
                                break;
                            }
                        }
                    }
                    if (base.InternalSharedConfigurationId == null)
                    {
                        base.InternalSharedConfigurationId = SharedConfiguration.FindOneSharedConfigurationId(sharedConfigurationInfo, base.CurrentOrganizationId.PartitionId);
                    }
                    if (base.InternalSharedConfigurationId == null)
                    {
                        base.WriteError(new SharedConfigurationValidationException(Strings.ErrorSharedConfigurationNotFound(this.tenantCU.ProgramId, offerId, sharedConfigurationInfo.CurrentVersion.ToString())), ExchangeErrorCategory.Client, null);
                    }
                }
                else
                {
                    base.WriteError(new SharedConfigurationValidationException(Strings.ErrorSharedConfigurationUpgradeNotSupported), ExchangeErrorCategory.Client, null);
                }
            }
            Exception ex4 = Utils.ValidateTransportRuleRegexesForMigratingTenants(this.tenantCU.OrganizationId);

            if (ex4 != null)
            {
                base.WriteError(new SharedConfigurationValidationException(Strings.ErrorE14TenantRulesNeedUpdateBeforeMigratingToE15(ex4.Message)), ExchangeErrorCategory.Client, null);
            }
            TaskLogger.LogExit();
        }
Ejemplo n.º 12
0
 ExchangeConfigurationUnit[] ITenantConfigurationSession.FindSharedConfiguration(SharedConfigurationInfo sharedConfigInfo, bool enabledSharedOrgOnly)
 {
     return(base.InvokeWithAPILogging <ExchangeConfigurationUnit[]>(() => this.GetSession().FindSharedConfiguration(sharedConfigInfo, enabledSharedOrgOnly), "FindSharedConfiguration"));
 }
        internal static ExchangeConfigurationUnit[] FindSharedConfigurations(SharedConfigurationInfo sci, PartitionId partitionId)
        {
            ITenantConfigurationSession tenantConfigurationSession = DirectorySessionFactory.Default.CreateTenantConfigurationSession(ConsistencyMode.FullyConsistent, ADSessionSettings.FromAllTenantsPartitionId(partitionId), 406, "FindSharedConfigurations", "f:\\15.00.1497\\sources\\dev\\Management\\src\\Management\\Deployment\\OrganizationTaskHelper.cs");

            return(tenantConfigurationSession.FindSharedConfiguration(sci, true));
        }
Ejemplo n.º 14
0
 ExchangeConfigurationUnit[] ITenantConfigurationSession.FindSharedConfiguration(SharedConfigurationInfo sharedConfigInfo, bool enabledSharedOrgOnly)
 {
     FfoDirectorySession.LogNotSupportedInFFO(null);
     return(new ExchangeConfigurationUnit[0]);
 }
Ejemplo n.º 15
0
        protected override void InternalBeginProcessing()
        {
            TaskLogger.LogEnter();
            if (this.nameWarning != LocalizedString.Empty)
            {
                this.WriteWarning(this.nameWarning);
            }
            base.InternalBeginProcessing();
            if (this.Administrator != null)
            {
                OrganizationTaskHelper.ValidateParamString("Administrator", this.Administrator.ToString(), new Task.TaskErrorLoggingDelegate(base.WriteError));
            }
            if (this.AdministratorNetID != null)
            {
                OrganizationTaskHelper.ValidateParamString("AdministratorNetID", this.AdministratorNetID.ToString(), new Task.TaskErrorLoggingDelegate(base.WriteError));
            }
            if (this.AdministratorNetID != null && this.Administrator != null && this.Administrator.NetId != null && !this.AdministratorNetID.Equals(this.Administrator.NetId))
            {
                base.WriteError(new RecipientTaskException(Strings.ErrorNetIDValuesDoNotMatch(this.AdministratorNetID.ToString(), this.Administrator.NetId.ToString())), ErrorCategory.InvalidArgument, null);
            }
            if (this.AdministratorNetID != null && this.Administrator == null)
            {
                this.Administrator = new WindowsLiveId(this.AdministratorNetID.ToString());
            }
            if (base.Fields.IsModified("TenantDirSyncServiceInstance") && !string.IsNullOrEmpty(this.DirSyncServiceInstance) && !ServiceInstanceId.IsValidServiceInstanceId(this.DirSyncServiceInstance))
            {
                base.WriteError(new InvalidServiceInstanceIdException(this.DirSyncServiceInstance), ExchangeErrorCategory.Client, null);
            }
            if (this.ServicePlanConfig.IsPilotOffer(this.ProgramId, this.OfferId) && !this.CreateSharedConfiguration)
            {
                base.WriteError(new ArgumentException(Strings.ErrorPilotServicePlanCanBeUsedToCreateSharedOrgsOnly(this.ProgramId, this.OfferId)), (ErrorCategory)1000, null);
            }
            Exception ex   = null;
            string    text = null;

            if (base.Fields["TenantExternalDirectoryOrganizationId"] == null && !this.CreateSharedConfiguration)
            {
                base.Fields["TenantExternalDirectoryOrganizationId"] = Guid.NewGuid();
            }
            try
            {
                bool flag = this.ServicePlanConfig.TryGetHydratedOfferId(this.ProgramId, this.OfferId, out text);
                if (!this.CreateSharedConfiguration && this.Name == null)
                {
                    base.WriteError(new ArgumentException(Strings.ErrorNameNotSet), (ErrorCategory)1000, null);
                }
                this.partition = ((this.AccountPartition != null) ? NewOrganizationTask.ResolvePartitionId(this.AccountPartition, new Task.TaskErrorLoggingDelegate(base.WriteError)) : NewOrganizationTask.ChoosePartition(this.Name, this.CreateSharedConfiguration, new Task.TaskErrorLoggingDelegate(base.WriteError)));
                if (this.CreateSharedConfiguration && flag)
                {
                    this.OfferId         = text;
                    this.shouldCreateSCT = NewOrganizationTask.ShouldCreateSharedConfiguration(this.ProgramId, this.OfferId, this.partition, out this.sctConfigUnit);
                }
                string text2 = this.ServicePlanConfig.ResolveServicePlanName(this.ProgramId, this.OfferId);
                this.servicePlanSettings = this.ServicePlanConfig.GetServicePlanSettings(text2);
                bool flag2 = this.ServicePlanConfig.IsTemplateTenantServicePlan(this.servicePlanSettings);
                if (flag2)
                {
                    this.shouldCreateSCT = NewOrganizationTask.ShouldCreateTenantTemplate(this.ProgramId, this.OfferId, this.partition, out this.sctConfigUnit);
                }
                if (this.CreateSharedConfiguration)
                {
                    if (!this.shouldCreateSCT)
                    {
                        this.WriteWarning(Strings.WarningSharedConfigurationAlreadyExists(this.ProgramId, this.OfferId));
                        return;
                    }
                    if (string.IsNullOrEmpty(this.Name))
                    {
                        this.Name = (flag2 ? TemplateTenantConfiguration.CreateSharedConfigurationName(this.ProgramId, this.OfferId) : SharedConfiguration.CreateSharedConfigurationName(this.ProgramId, this.OfferId));
                    }
                    if (this.DomainName == null)
                    {
                        this.DomainName = (flag2 ? TemplateTenantConfiguration.CreateSharedConfigurationDomainName(this.Name) : SharedConfiguration.CreateSharedConfigurationDomainName(this.Name));
                    }
                }
                OrganizationTaskHelper.ValidateParamString("Name", this.Name, new Task.TaskErrorLoggingDelegate(base.WriteError), true);
                ADOrganizationalUnit adorganizationalUnit = new ADOrganizationalUnit();
                adorganizationalUnit[ADObjectSchema.Name] = this.Name;
                base.InternalIsSharedConfigServicePlan    = this.ServicePlanConfig.IsSharedConfigurationAllowedForServicePlan(this.servicePlanSettings);
                if (this.CreateSharedConfiguration && !base.InternalIsSharedConfigServicePlan && !this.ServicePlanConfig.IsHydratedOffer(text2))
                {
                    base.WriteError(new SharedConfigurationValidationException(Strings.ErrorServicePlanDoesntAllowSharedConfiguration(this.ProgramId, this.OfferId)), (ErrorCategory)1000, null);
                }
                else if (!flag && base.InternalIsSharedConfigServicePlan)
                {
                    text = this.OfferId;
                }
                if (this.CreateSharedConfiguration)
                {
                    base.InternalCreateSharedConfiguration = true;
                }
                else if (!this.CreateSharedConfiguration && base.InternalIsSharedConfigServicePlan)
                {
                    SharedConfigurationInfo sharedConfigurationInfo = SharedConfigurationInfo.FromInstalledVersion(this.ProgramId, text);
                    base.InternalSharedConfigurationId = SharedConfiguration.FindOneSharedConfigurationId(sharedConfigurationInfo, this.partition);
                    if (base.InternalSharedConfigurationId == null)
                    {
                        base.WriteError(new SharedConfigurationValidationException(Strings.ErrorSharedConfigurationNotFound(this.ProgramId, text, sharedConfigurationInfo.CurrentVersion.ToString())), (ErrorCategory)1000, null);
                    }
                    base.InternalCreateSharedConfiguration = false;
                }
                List <ValidationError> list = new List <ValidationError>();
                list.AddRange(ServicePlan.ValidateFileSchema(text2));
                list.AddRange(this.servicePlanSettings.Validate());
                if (list.Count != 0)
                {
                    ex = new ArgumentException(Strings.ErrorServicePlanInconsistent(text2, this.ProgramId, this.OfferId, ValidationError.CombineErrorDescriptions(list)));
                }
            }
            catch (ArgumentException ex2)
            {
                ex = ex2;
            }
            catch (IOException ex3)
            {
                ex = ex3;
            }
            if (ex != null)
            {
                base.WriteError(ex, ErrorCategory.InvalidArgument, null);
            }
            base.InternalLocalStaticConfigEnabled      = (!this.servicePlanSettings.Organization.AdvancedHydrateableObjectsSharedEnabled || this.CreateSharedConfiguration);
            base.InternalLocalHydrateableConfigEnabled = (!this.servicePlanSettings.Organization.CommonHydrateableObjectsSharedEnabled || this.CreateSharedConfiguration);
            TaskLogger.LogExit();
        }