Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error in client with remoting

Status
Not open for further replies.

Craftor

Programmer
Feb 1, 2001
420
NZ
Hi all

I have created a server and client app using remoting. When an event is fired in the server - the client needs to pick it up. When trying to create the event handler in the client, I get the following error:

Cannot find the assembly Blah, Version=1.0.1521.20819, Culture=neutral, PublicKeyToken=null.

This is the code I am using to create the client object and its event handler:

Code:
try
{
   SpectatorServer obj = (SpectatorServer)  
   Activator.GetObject(typeof(Spectator.SpectatorServer), 
   "tcp://localhost:" + GetPort()  +"/WatchObject");
   if (obj == null) return "Could not find server...";
   else 
   {
      obj.ValueChangedEvent += new 
      SpectatorServer.eventHandler
      (this.Watcher_ValueChangedEvent);
      return(obj.GetLatest());
   }
}
catch (Exception e)
{
   textBox1.Text += e.Message;
   MessageBox.Show(e.StackTrace);
   return "";
}

If I take out the line
Code:
obj.ValueChangedEvent+= new SpectatorServer.eventHandler(this.Watcher_ValueChangedEvent);

the rest runs fine.

Does anyone know what I'm doing wrong that is causing this? I'm using the .NET Framework 1.1 for this.

Let me know if anything is unclear or if you want me to post anything else to clarify this.

Thanks as always

Craftor
:cool:
 
>If I take out the line ...the rest runs fine.
What do you mean ? Evrything is working or evrything is compiling?
As I can see, you should have something between client and server and this something has to be linked with each one side: client and server.
-obislavu-

 
obislavu - if I comment that line out and compile - my client can access the remote DLL's method without error - i.e. the error is occurring when I try to attach the event handler to the remote DLL's event.

Thanks as always

Craftor
:cool:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top