CCNet.ProjectChecker.Program.CheckWrongReleaseProperties C# (CSharp) Метод

CheckWrongReleaseProperties() приватный статический Метод

Checks "WrongReleaseProperties" condition.
private static CheckWrongReleaseProperties ( ) : void
Результат void
		private static void CheckWrongReleaseProperties()
		{
			Dictionary<string, string> properties = ProjectHelper.GetReleaseProperties();
			Dictionary<string, string> required = new Dictionary<string, string>();
			Dictionary<string, string> allowed = new Dictionary<string, string>();

			if (Arguments.AllowUnsafeBlocks)
			{
				required.Add("AllowUnsafeBlocks", "true");
			}
			else
			{
				allowed.Add("AllowUnsafeBlocks", "false");
			}

			allowed.Add("BaseAddress", "285212672");
			allowed.Add("CheckForOverflowUnderflow", "false");
			allowed.Add("CodeAnalysisModuleSuppressionsFile", null);
			allowed.Add("CodeAnalysisFailOnMissingRules", null);
			allowed.Add("CodeAnalysisIgnoreBuiltInRules", null);
			allowed.Add("CodeAnalysisIgnoreBuiltInRuleSets", null);
			allowed.Add("CodeAnalysisIgnoreGeneratedCode", null);
			allowed.Add("CodeAnalysisLogFile", null);
			allowed.Add("CodeAnalysisRuleDirectories", null);
			allowed.Add("CodeAnalysisRules", null);
			allowed.Add("CodeAnalysisRuleSet", null);
			allowed.Add("CodeAnalysisRuleSetDirectories", null);
			allowed.Add("CodeAnalysisUseTypeNameInSuppression", null);
			allowed.Add("CodeContractsArithmeticObligations", null);
			allowed.Add("CodeContractsAnalysisWarningLevel", null);
			allowed.Add("CodeContractsBaseLineFile", null);
			allowed.Add("CodeContractsBoundsObligations", null);
			allowed.Add("CodeContractsCacheAnalysisResults", null);
			allowed.Add("CodeContractsCustomRewriterAssembly", null);
			allowed.Add("CodeContractsCustomRewriterClass", null);
			allowed.Add("CodeContractsDisjunctiveRequires", null);
			allowed.Add("CodeContractsEmitXMLDocs", null);
			allowed.Add("CodeContractsEnableRuntimeChecking", null);
			allowed.Add("CodeContractsEnumObligations", null);
			allowed.Add("CodeContractsExtraAnalysisOptions", null);
			allowed.Add("CodeContractsExtraRewriteOptions", null);
			allowed.Add("CodeContractsInferEnsures", null);
			allowed.Add("CodeContractsInferObjectInvariants", null);
			allowed.Add("CodeContractsInferRequires", null);
			allowed.Add("CodeContractsLibPaths", null);
			allowed.Add("CodeContractsNonNullObligations", null);
			allowed.Add("CodeContractsRedundantAssumptions", null);
			allowed.Add("CodeContractsReferenceAssembly", null);
			allowed.Add("CodeContractsRunCodeAnalysis", null);
			allowed.Add("CodeContractsRunInBackground", null);
			allowed.Add("CodeContractsRuntimeCallSiteRequires", null);
			allowed.Add("CodeContractsRuntimeCheckingLevel", null);
			allowed.Add("CodeContractsRuntimeOnlyPublicSurface", null);
			allowed.Add("CodeContractsRuntimeSkipQuantifiers", null);
			allowed.Add("CodeContractsSuggestAssumptions", null);
			allowed.Add("CodeContractsSuggestEnsures", null);
			allowed.Add("CodeContractsSuggestObjectInvariants", null);
			allowed.Add("CodeContractsSuggestRequires", null);
			allowed.Add("CodeContractsRuntimeThrowOnFailure", null);
			allowed.Add("CodeContractsShowSquigglies", null);
			allowed.Add("CodeContractsUseBaseLine", null);
			allowed.Add("CodeContractsMissingPublicRequiresAsWarnings", null);
			allowed.Add("CodeContractsSQLServerOption", null);
			allowed.Add("CodeContractsFailBuildOnWarnings", null);
			allowed.Add("ConfigurationOverrideFile", String.Empty);
			allowed.Add("DebugSymbols", "true");
			required.Add("DebugType", "pdbonly");
			required.Add("DefineConstants", "TRACE");
			required.Add("ErrorReport", "prompt");
			allowed.Add("ExcludeGeneratedDebugSymbol", null);
			allowed.Add("FileAlignment", "512");
			allowed.Add("FxCopRules", null);
			allowed.Add("NoStdLib", "false");

			switch (Arguments.ProjectType)
			{
				case ProjectType.Test:
					allowed.Add("NoWarn", null);
					break;
				default:
					if (String.IsNullOrEmpty(Arguments.SuppressWarnings))
					{
						allowed.Add("NoWarn", Arguments.SuppressWarnings);
					}
					else
					{
						required.Add("NoWarn", Arguments.SuppressWarnings);
					}

					break;
			}

			required.Add("Optimize", "true");

			switch (Arguments.ProjectType)
			{
				case ProjectType.WebService:
				case ProjectType.WebSite:
					required.Add("OutputPath", @"bin\");
					required.Add("DocumentationFile", @"bin\{0}.xml".Display(Arguments.AssemblyName));
					break;
				case ProjectType.Test:
				case ProjectType.Azure:
					required.Add("OutputPath", @"bin\Release\");
					allowed.Add("DocumentationFile", null);
					break;
				default:
					required.Add("OutputPath", @"bin\Release\");
					required.Add("DocumentationFile", @"bin\Release\{0}.xml".Display(Arguments.AssemblyName));
					break;
			}

			allowed.Add("PlatformTarget", Arguments.TargetPlatform);
			allowed.Add("RegisterForComInterop", "false");
			allowed.Add("RemoveIntegerChecks", "false");
			allowed.Add("TreatWarningsAsErrors", "false");
			required.Add("WarningLevel", "4");
			allowed.Add("UseVSHostingProcess", null);

			string description;
			if (ValidationHelper.CheckProperties(
				properties,
				required,
				allowed,
				out description))
				return;

			RaiseError.WrongReleaseProperties(description);
		}