Cannot find the assembly, error on events - remoting
-
HI can anybody help me to solve the problm, it will be a great helpfull. I am using remoting and i wants to raise an event in client from server. here s the code SERVER using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace UpdTrackSrvr { public class Server { public Server() { } public static void Main(string [] args) { //select channel to communicate BinaryServerFormatterSinkProvider oSrvrProv = new BinaryServerFormatterSinkProvider(); oSrvrProv.TypeFilterLevel = System.Runtime.Serialization.Formatters.TypeFilterLevel.Full; BinaryClientFormatterSinkProvider oClProv = new BinaryClientFormatterSinkProvider(); IDictionary Dict = new Hashtable(); Dict["port"] = 8085; TcpChannel chnChanl = new TcpChannel(Dict, oClProv, oSrvrProv); ChannelServices.RegisterChannel(chnChanl); UpdTrig oUpdTrig = new UpdTrig(); RemotingConfiguration.RegisterWellKnownServiceType(oUpdTrig.GetType(), "UpdTrackSrvr", WellKnownObjectMode.Singleton); System.Windows.Forms.MessageBox.Show("Server Activated"); } } } UpdTrig using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace UpdTrackSrvr { public delegate void del_ev(); public class UpdTrig : MarshalByRefObject { public event del_ev UpdEvt; public UpdTrig() { } public String ReplyMessage(String msg) { System.Windows.Forms.MessageBox.Show("Client : "+ msg); return "Server : s! I'm here"; } public void RaiseEvent() { UpdEvt(); } } } CLIENT using System; using System.Runtime.Remoting; using System.Runtime.Remoting.Channels; using System.Runtime.Remoting.Channels.Tcp; namespace UpdTrackClnt { public sealed class Loader { public static void Main(string [] args) { new Client().RaiseRemoteEvent(); } } public class Client : MarshalByRefObject { private UpdTrackSrvr.UpdTrig oUpdTrig; public override object InitializeLifetimeService() { return null; } public Client() { TcpChannel chan = new TcpChannel(); ChannelServices.RegisterChannel(chan); oUpdTrig = (UpdTrackSrvr.UpdTrig) Activator.GetObject( typeof(UpdTrackSrvr.UpdTrig), "tcp://localhost:8085/UpdTrackSrvr"); // oUpdTrig.ReplyMessage("Hello?"); oUpdTrig.UpdEvt += new UpdTrackSrvr.del_ev(oUpdTrig_UpdE