【问题标题】:Unregister remoting type?注销远程类型?
【发布时间】:2016-09-07 10:23:39
【问题描述】:

我希望能够从不同服务器上的桌面连接到程序集中的函数。假设我在 x.dll 中有函数 foo()。我想在服务器 1 上调用 foo,然后在服务器 2 上调用 foo 等。我该怎么做?我更喜欢做远程处理。如果不可能,那么 wcf. 我尝试通过远程处理来做到这一点。我首先在一台服务器上配置它,当我尝试在另一台服务器上配置时出现异常。 远程配置失败,出现异常“System.Runtime.Remoting.RemotingException:尝试重定向已重定向的“ControlServices.Controler,ControlServices”类型的激活。在 System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.AddActivatedClientType(ActivatedClientTypeEntry entry) 在 System.Runtime.Remoting.RemotingConfiguration.RegisterActivatedClientType(ActivatedClientTypeEntry entry) 在 System.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.StoreRemoteAppEntries(RemotingXmlConfigFileData configData) 在 System.Runtime .Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData configData, Boolean ensureSecurity)'。 这是我的代码。我在 RegisterActivatedClientType 上收到错误 TcpChannel 频道 = 新 TcpChannel(); ChannelServices.RegisterChannel(channel, true);

    ActivatedClientTypeEntry remotetype = new ActivatedClientTypeEntry( 
        typeof(Controler), 
        "tcp://172.22.110.25:8086"); 
    RemotingConfiguration.RegisterActivatedClientType(remotetype); 

    Controler control = new Controler(); 
    string str = control.ServiceState("SchedulerServiceIT"); 




    channel.StopListening(null); 
    //RemotingServices.Disconnect(control); 
    ChannelServices.UnregisterChannel(channel); 
    channel = null; 




     channel = new TcpChannel(); 
    ChannelServices.RegisterChannel(channel, true); 

     remotetype = new ActivatedClientTypeEntry( 
        typeof(Controler), 
        "tcp://172.22.110.25:8086"); 
    RemotingConfiguration.RegisterActivatedClientType(remotetype); 

     control = new Controler(); 
     str = control.ServiceState("SchedulerServiceIT");

【问题讨论】:

  • 至少注意格式化您的问题,使其可读。

标签: .net wcf remoting


【解决方案1】:

找到了解决办法。 我为远程对象上的每个调用创建一个应用程序域。 喜欢这篇文章 http://www.codeproject.com/Articles/28759/RemotingConfiguration-Unconfigure

【讨论】:

    猜你喜欢
    • 2017-01-17
    • 1970-01-01
    • 1970-01-01
    • 2017-09-15
    • 2019-07-31
    • 2022-09-27
    • 1970-01-01
    • 1970-01-01
    • 2011-09-01
    相关资源
    最近更新 更多