无法创建连接到信道接收器,可能尚未注册适当的信道

今天,我在调试.NET REMOTING服务的时候,老是出现下面错误,一直想不通为什么;

在网上搜了很久,读的文章都没有让我找到答案;

刚才在http://www.vbforums.com/showthread.php?t=387770 这篇文章看到说是远程服务地址错误的问题;我半信半疑地检查了我的错误信息,发现远程地址是

 172.16.144.28:8585/MAM.CommandService,一下就反应过来,少了TCP://,太神奇了,找了那么久居然一直没发现这个问题,崩溃中。。。

错误信息: 

System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.TypeInitializationException: “你的类”的类型初始值设定项引发异常。 ---> Exception: GetService :CommandService ---> Exception: Get service object failed! ServiceURL: 172.16.144.28:8585andService ---> System.Runtime.Remoting.RemotingException: 无法创建连接到 URL“172.16.144.28:8585/CommandService”的信道接收器。可能尚未注册适当的信道。

   在 System.Runtime.Remoting.RemotingServices.Unmarshal(Type classToProxy, String url, Object data)
   在 System.Activator.GetObject(Type type, String url, Object state)
   在 System.Activator.GetObject(Type type, String url)

解决办法:

将 172.16.144.28:8585/CommandService前面加上tcp://172.16.144.28:8585/CommandService

原文地址:https://www.cnblogs.com/zjoch/p/1967155.html