Click here to Skip to main content
15,890,438 members
Home / Discussions / C#
   

C#

 
AnswerRe: progress bar help Pin
Christian Graus17-Mar-07 3:48
protectorChristian Graus17-Mar-07 3:48 
Questionvbscript empty memory from defined variable Pin
Mohammad Daba'an16-Mar-07 21:34
Mohammad Daba'an16-Mar-07 21:34 
AnswerRe: vbscript empty memory from defined variable Pin
PlayByTheRules17-Mar-07 0:33
PlayByTheRules17-Mar-07 0:33 
GeneralRe: vbscript empty memory from defined variable Pin
Mohammad Daba'an17-Mar-07 0:47
Mohammad Daba'an17-Mar-07 0:47 
GeneralRe: vbscript empty memory from defined variable Pin
PlayByTheRules17-Mar-07 1:15
PlayByTheRules17-Mar-07 1:15 
GeneralRe: vbscript empty memory from defined variable Pin
Mohammad Daba'an17-Mar-07 1:18
Mohammad Daba'an17-Mar-07 1:18 
GeneralRe: vbscript empty memory from defined variable Pin
Dave Kreskowiak17-Mar-07 4:03
mveDave Kreskowiak17-Mar-07 4:03 
QuestionCannot find the assembly, error on events - remoting Pin
panalprasad16-Mar-07 21:15
panalprasad16-Mar-07 21:15 
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_UpdEvt);
oUpdTrig.RaiseEvent();
}

public void oUpdTrig_UpdEvt()
{
System.Windows.Forms.MessageBox.Show("EVENT");
}
}
}


The server side running fine, but when i run the client, when execution is on the line " oUpdTrig.UpdEvt += new UpdTrackSrvr.del_ev(oUpdTrig_UpdEvt);
" then i gets an error "Cannot find the assembly UpdTrackClnt, Version=1.0.2632.26133, Culture=neutral, PublicKeyToken=null."

I m stuck in the line

Thanks in advance



Panal
QuestionAccess individual items from a binding source Pin
12425616-Mar-07 20:30
12425616-Mar-07 20:30 
QuestionSimple Search Pin
tampasounds16-Mar-07 19:29
tampasounds16-Mar-07 19:29 
AnswerRe: Simple Search Pin
Naveed Kamboh18-Mar-07 4:34
Naveed Kamboh18-Mar-07 4:34 
Questionhow to convert from string(text) to binary representation Pin
Hasan ACAR16-Mar-07 17:55
Hasan ACAR16-Mar-07 17:55 
AnswerRe: how to convert from string(text) to binary representation Pin
Christian Graus16-Mar-07 18:43
protectorChristian Graus16-Mar-07 18:43 
QuestionDouble type Pin
Dothanhnam16-Mar-07 17:37
Dothanhnam16-Mar-07 17:37 
AnswerRe: Double type Pin
Christian Graus16-Mar-07 17:58
protectorChristian Graus16-Mar-07 17:58 
AnswerRe: Double type Pin
Leslie Sanford16-Mar-07 18:10
Leslie Sanford16-Mar-07 18:10 
Questionits multithreading not enough?? Pin
duke_tj16-Mar-07 16:04
duke_tj16-Mar-07 16:04 
Questiondot net remoting problem Pin
Tauseef A16-Mar-07 15:52
Tauseef A16-Mar-07 15:52 
AnswerRe: dot net remoting problem Pin
Karthik Kalyanasundaram16-Mar-07 16:06
Karthik Kalyanasundaram16-Mar-07 16:06 
QuestionRe: dot net remoting problem Pin
Tauseef A17-Mar-07 10:44
Tauseef A17-Mar-07 10:44 
AnswerRe: dot net remoting problem Pin
Karthik Kalyanasundaram18-Mar-07 5:31
Karthik Kalyanasundaram18-Mar-07 5:31 
QuestionHow to create a non-visual component? Pin
Tim Huetz16-Mar-07 13:42
Tim Huetz16-Mar-07 13:42 
AnswerRe: How to create a non-visual component? Pin
Daniel Grunwald16-Mar-07 14:23
Daniel Grunwald16-Mar-07 14:23 
GeneralRe: How to create a non-visual component? Pin
Tim Huetz17-Mar-07 0:53
Tim Huetz17-Mar-07 0:53 
Questionhow to wait for button press Pin
bluefl4me16-Mar-07 12:28
bluefl4me16-Mar-07 12:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.