我需要通过代码重现此app.config
服务文件。C#
<system.serviceModel>
....
<protocolMapping>
<add scheme="https" binding="wsHttpBinding" />
</protocolMapping>
...
特别是scheme
部分,所以我这样做了:
var binding = new WSHttpBinding();
binding.Security.Mode = SecurityMode.Transport;
...
但是如果我尝试做一个binding.Scheme = ...
我得到编译时错误the property Scheme has no setter
。
如何通过代码设置?