public void DoCheckPrereqs(Action <int> writeProgress, Microsoft.Exchange.Configuration.Tasks.Task task) { PrereqAnalysis prereqAnalysis = new PrereqAnalysis(this.DataProviderFactory, this.mode, this.role, this.globalParameters); this.DoAnalysis(writeProgress, prereqAnalysis); try { SetupLogger.IsPrereqLogging = true; foreach (Result result in prereqAnalysis.Conclusions) { RuleResult ruleResult = (RuleResult)result; if (!ruleResult.HasException && ruleResult.Value) { Rule rule = (Rule)ruleResult.Source; string text = string.Empty; MessageFeature messageFeature = (MessageFeature)rule.Features.First((Feature x) => x.GetType() == typeof(MessageFeature)); if (messageFeature != null) { text = messageFeature.Text(ruleResult); } RuleTypeFeature ruleTypeFeature = (RuleTypeFeature)rule.Features.FirstOrDefault((Feature x) => x.GetType() == typeof(RuleTypeFeature)); if (ruleTypeFeature != null) { RuleType ruleType = ruleTypeFeature.RuleType; LocalizedString text2 = new LocalizedString(text); string helpUrl = ruleResult.GetHelpUrl(); if (ruleType == RuleType.Error) { task.WriteError(new Exception(text), ErrorCategory.NotSpecified, rule.Name, false, helpUrl); } else if (ruleType == RuleType.Warning) { task.WriteWarning(text2, helpUrl); } else { task.WriteVerbose(text2); } } } } } finally { SetupLogger.IsPrereqLogging = false; } }