【发布时间】:2017-08-08 11:51:09
【问题描述】:
当我尝试在 dotnet 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
【问题讨论】:
-
WCF 客户端代码能否进入面向 .NET Standard 的类库?然后您可以从 .NET Core 调用该库。这个SO answer 可能是相关的。
-
您在使用 WCF 连接服务吗? marketplace.visualstudio.com/…
-
WCF 连接的服务给了我一个错误,出于同样的原因。不支持,错误信息只是略有不同..github.com/dotnet/wcf/issues/1274
-
@Boggin 我已经生成了服务,它的连接给出了错误。
-
有人找到解决方案了吗?
标签: c# .net wcf asp.net-core .net-core