Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/334.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# System.Net.Sockets.SocketException:请求的名称有效,但未找到请求类型的数据_C# - Fatal编程技术网

C# System.Net.Sockets.SocketException:请求的名称有效,但未找到请求类型的数据

C# System.Net.Sockets.SocketException:请求的名称有效,但未找到请求类型的数据,c#,C#,我有一个使用远程处理的C#应用程序。但是,一些客户最近报告了一个问题。我的代码中有一个异常: System.Net.Sockets.SocketException:请求的名称有效,但未找到请求类型的数据 创建新的tcp频道时出现异常。我使用的代码是: BinaryServerFormatterSinkProvider binaryServiceProvider = new BinaryServerFormatterSinkProvider(); binaryServiceProvider.Typ

我有一个使用远程处理的C#应用程序。但是,一些客户最近报告了一个问题。我的代码中有一个异常:

System.Net.Sockets.SocketException:请求的名称有效,但未找到请求类型的数据

创建新的
tcp频道时出现异常。我使用的代码是:

BinaryServerFormatterSinkProvider binaryServiceProvider = new BinaryServerFormatterSinkProvider();
binaryServiceProvider.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full;
BinaryClientFormatterSinkProvider binaryclientProv = new BinaryClientFormatterSinkProvider();
IDictionary props = new Hashtable();
props["port"] = portNo;//PortNumber I use is 20052
props["name"] = "ApplicationName";
try
{
    TcpChannel channel = new TcpChannel(props, binaryclientProv, binaryServiceProvider);
    ChannelServices.RegisterChannel(channel, false);
}
catch (Exception a_Exception)
{
    System.Diagnostics.Debug.WriteLine(a_Exception);
    System.Diagnostics.Trace.WriteLine(a_Exception);
} 
可能相关: