private static NetTcpBinding CreateBinding() { NetTcpBinding binding = new NetTcpBinding(); //binding.PortSharingEnabled = true; //portsharingBinding.ReliableSession.Enabled = true; //portsharingBinding.ReliableSession.Ordered = false; binding.MaxReceivedMessageSize = 1000000; XmlDictionaryReaderQuotas myReaderQuotas = new XmlDictionaryReaderQuotas(); myReaderQuotas.MaxStringContentLength = 10000; myReaderQuotas.MaxArrayLength = 10000; myReaderQuotas.MaxBytesPerRead = 10000; myReaderQuotas.MaxDepth = 10000; myReaderQuotas.MaxNameTableCharCount = 10000; binding.GetType().GetProperty("ReaderQuotas").SetValue(binding, myReaderQuotas, null); return binding; }