I'm trying to create a Binding, but everytime that I do, it gives me errors about
NotSupportedException: The value 'TransportWithMessageCredential' is not supported in this context for the binding security property 'Mode'. at System.ServiceModel.HttpBindingBase.CheckSettings()
Here's my code:
    Binding CreateBinding()
    {
        var binding = new BasicHttpBinding();
        binding.Security.Mode = BasicHttpSecurityMode.TransportWithMessageCredential;
        var elements = binding.CreateBindingElements();
        elements.Find<SecurityBindingElement>().IncludeTimestamp = false;
        return new CustomBinding(elements);
    }