当我尝试在.NET Core 2.0中创建与WCF客户端的连接时,我收到一个平台不支持的错误:
System.PlatformNotSupportedException: 'The value 'TransportWithMessageCredential' is not supported in this context for the binding security property 'securityMode'.'
如果我移除了
BasicHttpSecurityMode
,我会收到一个参数异常:
System.ArgumentException:“所提供的URI方案'HTTPS'无效;应为'http'。”代码:
ChannelFactory<BlackBoxContract> factory = null;
BlackBoxContract serviceProxy = null;
Binding binding = null;
binding = new BasicHttpBinding(BasicHttpSecurityMode.TransportWithMessageCredential);
factory = new ChannelFactory<BlackBoxContract>(binding, new EndpointAddress("https:......."));;
serviceProxy = factory.CreateChannel();
有没有人找到了这个问题的解决方法,可能会被纳入长期路线图中吗? https://github.com/dotnet/wcf/issues/8