当我尝试在 dotnet core 2.0 中创建与 WCF 客户端的连接时,收到平台不支持的错误:
System.PlatformNotSupportedException: 'The value 'TransportWithMessageCredential' is not supported in this context for the binding security property 'securityMode'.'
Run Code Online (Sandbox Code Playgroud)
如果我删除BasicHttpSecurityMode,我会收到一个参数异常: System.ArgumentException: 'The provided URI scheme 'https' is invalid; 应为“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();
Run Code Online (Sandbox Code Playgroud)
任何找到解决方法的人,因为这可能在长期路线图上? https://github.com/dotnet/wcf/issues/8