小编Jel*_*sch的帖子

.net 核心中的 WCF (TransportWithMessageCredential)

当我尝试在 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

.net c# wcf .net-core asp.net-core

6
推荐指数
2
解决办法
6958
查看次数

标签 统计

.net ×1

.net-core ×1

asp.net-core ×1

c# ×1

wcf ×1