0

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);
    }
PaulLeonH
  • 53
  • 1
  • 4

1 Answers1

0

Try this ... WCF in .net core (TransportWithMessageCredential)

John White
  • 705
  • 4
  • 12