static void Main() { RemotingConfiguration.Configure("Client.exe.config"); RemObj obj = new RemObj(); ClSponsor sponsor = new ClSponsor(); sponsor.RenewalTime = TimeSpan.FromSeconds(5); sponsor.Register(obj); Console.WriteLine(obj.Hello()); Console.ReadLine(); Console.WriteLine(obj.Hello()); Console.ReadLine(); sponsor.Unregister(obj); }
static void Main(string[] args) { int v = 7; RemotingConfiguration.Configure("Client.exe.config", /*ensureSecurity*/ true); // o booleano é pq a outra versão ficou deprecada RemObj obj = new RemObj(); Console.WriteLine(obj.Hello()); Console.ReadLine(); }