.net remoting
От: av0000  
Дата: 08.03.06 08:08
Оценка:
Добрый день

Необходимо подключится через tcp к серверу для вызова методов удаленного объекта.
Нашел пример в MSDN


using System;
using System.Runtime.Remoting;
using System.Runtime.Remoting.Channels;
using System.Runtime.Remoting.Channels.Tcp;

namespace RemotingSamples {
public class Client {
public static int Main(string [] args) {
TcpChannel chan = new TcpChannel();
ChannelServices.RegisterChannel(chan);
HelloServer obj = (HelloServer)Activator.GetObject(
typeof(RemotingSamples.HelloServer),
"tcp://localhost:8085/SayHello");
if (obj == null) System.Console.WriteLine("Could not locate server");
else Console.WriteLine(obj.HelloMethod("Caveman"));
return 0;
}
}
}

но на строчке using System.Runtime.Remoting.Channels.Tcp; выдается ошибка

The type or namespace name 'Tcp' does not exist in the class or namespace 'System.Runtime.Remoting.Channels' (are you missing an assembly reference?)

В чем может быть проблема?
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.