我想为Silverlight4客户端以编程方式配置NetTcpBinding。(现在支持nettcpbinding)
以下是我为Windows窗体客户端执行此操作时使用的代码:
EndpointAddress endpointAddress = new EndpointAddress(uri);
NetTcpBinding netTcpBinding = new NetTcpBinding();
MyServiceClient agentClient = new MyServiceClient(new InstanceContext(this), netTcpBinding, endpointAddress);
对于Silverlight,我添加了对System.ServiceModel.Extensions和System.ServiceModel.NetTcp的引用,但这还不够:我找不到NetTcpBinding类。
如果这个类存在,它在哪里?是否存在等效语法?使用配置文件时,Silverlight4运行时必须以某种方式执行此操作。