私は別のサーバー上で私のデスクトップからアセンブリー内の関数に接続できるようにしたい。 x.dllに関数foo()があるとします。私はサーバ1上でfooを呼び出し、サーバ2上でfooを呼び出す必要があります。どうすればいいですか?私はリモーティングの方が好きです。可能でなければwcf。 私はリモーティングでそれをしようとしました。私は最初にそれを1つのサーバーで構成しました。別のサーバーで構成しようとしたときに例外が発生しました。 例外 'System.Runtime.Remoting.RemotingException:既にリダイレクトされた' ControlServices.Controler、ControlServices 'タイプのアクティブ化をリダイレクトしようとしました。 System.RuntimeでSystem.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.StoreRemoteAppEntries(RemotingXmlConfigFileData CONFIGDATA)でSystem.Runtime.Remoting.RemotingConfiguration.RegisterActivatedClientType(ActivatedClientTypeEntryエントリー)でSystem.Runtime.Remoting.RemotingConfigHandler.RemotingConfigInfo.AddActivatedClientType(ActivatedClientTypeEntryエントリー)で.Remoting.RemotingConfigHandler.ConfigureRemoting(RemotingXmlConfigFileData configData、Boolean ensureSecurity) '。 これは私のコードです。 RegisterActivatedClientTypeでエラーが発生する TcpChannel channel = new 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");
少なくとも*あなたの質問を書式設定して読めるように注意してください。 –