Создание TcpChannel: не удалось привести тип объекта "System.Int32" к типу "System.String" - C#
Формулировка задачи:
Всем привет!
Скажите, пожалуйста, почему такая строчка не работает:
????
Выдаётся ошибка: Не удалось привести тип объекта "System.Int32" к типу "System.String".
В интернете нет примеров с другими параметрами для new TcpChannel.
Заранее спасибо!
TcpChannel channels = new TcpChannel(props, null, new BinaryServerFormatterSinkProvider());
Решение задачи: «Создание TcpChannel: не удалось привести тип объекта "System.Int32" к типу "System.String"»
textual
Листинг программы
ListDictionary channelProperties = new ListDictionary();
channelProperties.Add("port", 4000);
BinaryServerFormatterSinkProvider serverSinkProvider = new BinaryServerFormatterSinkProvider();
serverSinkProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
TcpChannel channel = new TcpChannel(channelProperties, null, serverSinkProvider);