void ValidateDescription(ServiceDescription description, ServiceHostBase serviceHost)
        {
            description.EnsureInvariants();
            (PartialTrustValidationBehavior.Instance as IServiceBehavior).Validate(description, serviceHost);
#pragma warning disable 0618
            (PeerValidationBehavior.Instance as IServiceBehavior).Validate(description, serviceHost);
#pragma warning restore 0618
            (TransactionValidationBehavior.Instance as IServiceBehavior).Validate(description, serviceHost);
            (System.ServiceModel.MsmqIntegration.MsmqIntegrationValidationBehavior.Instance as IServiceBehavior).Validate(description, serviceHost);
            (SecurityValidationBehavior.Instance as IServiceBehavior).Validate(description, serviceHost);
            (new UniqueContractNameValidationBehavior() as IServiceBehavior).Validate(description, serviceHost);
            for (int i = 0; i < description.Behaviors.Count; i++)
            {
                IServiceBehavior iServiceBehavior = description.Behaviors[i];
                iServiceBehavior.Validate(description, serviceHost);
            }
            for (int i = 0; i < description.Endpoints.Count; i++)
            {
                ServiceEndpoint endpoint = description.Endpoints[i];
                ContractDescription contract = endpoint.Contract;
                bool alreadyProcessedThisContract = false;
                for (int j = 0; j < i; j++)
                {
                    if (description.Endpoints[j].Contract == contract)
                    {
                        alreadyProcessedThisContract = true;
                        break;
                    }
                }
                endpoint.ValidateForService(!alreadyProcessedThisContract);
            }
        }