Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/339.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# .Net远程处理,无法连接到客户端中的远程服务器_C#_.net_Asp.net_Remoting_.net Remoting - Fatal编程技术网

C# .Net远程处理,无法连接到客户端中的远程服务器

C# .Net远程处理,无法连接到客户端中的远程服务器,c#,.net,asp.net,remoting,.net-remoting,C#,.net,Asp.net,Remoting,.net Remoting,我创建了一个窗口服务,并在本地计算机上注册了我的ServerRemoteObject,我的客户端应用程序在另一台连接到sSrverRemoteObject的计算机上,并且在本地主机上运行良好(我的计算机在局域网上)。但是,当我使用global.asax在我的ServerHost上模拟windows服务并注册remoteobject时,当我的客户端应用程序连接到RemoteServerObject时,我收到以下错误: 错误:“无法连接到远程服务器” 在我的服务器主机上的global.asax中的“

我创建了一个窗口服务,并在本地计算机上注册了我的ServerRemoteObject,我的客户端应用程序在另一台连接到sSrverRemoteObject的计算机上,并且在本地主机上运行良好(我的计算机在局域网上)。但是,当我使用global.asax在我的ServerHost上模拟windows服务并注册remoteobject时,当我的客户端应用程序连接到RemoteServerObject时,我收到以下错误:

错误:“无法连接到远程服务器”

在我的服务器主机上的global.asax中的“Application\u Start”:

protected void Application_Start(object sender, EventArgs e)
        {
           HttpChannel channel = new HttpChannel(9988);
            ChannelServices.RegisterChannel(channel, false);
            RemotingConfiguration.ApplicationName = "Proxy";
            RemotingConfiguration.RegisterWellKnownServiceType(typeof(ServerRemoteObject),
                "Server",
                WellKnownObjectMode.Singleton);
        }
连接ServerRemoteObject的客户端应用程序代码:

Library.IServer serverInstance = (Library.IServer)Activator.GetObject(typeof(Library.IServer), "http://hadeli.somee.com:9988/Proxy/Server");
                                    byte[] bytesRemotibg = serverInstance.Encrypt(GetRequseUrl(value));
                                    byte[] resultProcessRemoting = serverInstance.ProcessToRunning(bytesRemotibg);

我会在客户端捕获异常,并确保您从中获取所有信息(理想情况下是日志)。内部异常或堆栈跟踪应指示是否允许客户端连接到端点(包括端口)或服务器是否出现故障。您还应该在服务器中记录任何异常


第一步是确保您拥有尽可能多的信息。

您能够从服务器ping hadeli.somee.com吗?你们能从那个里看到9988端口吗?onof:我在网站上测试服务器打开的端口,但我的域上的9988是关闭的。在我的主机上,只有端口80,21是打开的。