我试图为我的自定义TCP传输绑定提供自定义方案,但是在启动服务主机时,它总是告诉我那个' net.tcp'预计:
public class MyTcpBinding: Binding
{
private readonly MyTcpTransportBindingElement _transport;
private readonly BinaryMessageEncodingBindingElement _binaryEncoding;
public override string Scheme
{
get { return "my.tcp"; }
}
public MyTcpBinding()
{
_transport = new MyTcpTransportBindingElement();
_binaryEncoding = new BinaryMessageEncodingBindingElement();
}
public override BindingElementCollection CreateBindingElements()
{
return new BindingElementCollection(new BindingElement[]
{
_binaryEncoding, _transport
});
}
}
public class MyTcpTransportBindingElement : TcpTransportBindingElement
{
public override string Scheme
{
get { return "my.tcp"; }
}
}
可以做些什么来解决这个问题?