Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Cannot find the assembly, error on events - remoting

Cannot find the assembly, error on events - remoting

Scheduled Pinned Locked Moved C#
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    panalprasad
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups