Micha_J
10/8/2004 1:37:00 PM
when i run the client without having the remote object, the busines logic dll
(HelloServer.dll) in the same directory i get an error message.
"File or assembly name Object not found"
If the HelloServer.dll is in the same directory everything works fine.
Does this mean I have to copy everytime the new server dll on the clients??
Is there a way to avoid this. I thought it would be possible to call a
remote object without having it on the clients
Thanks
Micha_J
all code is from the msdn remoting sample
server code
imports System
imports System.Runtime.Remoting
imports System.Runtime.Remoting.Channels
imports System.Runtime.Remoting.Channels.TCP
namespace RemotingSamples
public class Sample
shared sub main
dim chan as TCPChannel
chan = new TCPChannel(8085)
ChannelServices.RegisterChannel(chan)
RemotingConfiguration.RegisterWellKnownServiceType(Type.GetType("RemotingSamples.HelloServer, Object"), "SayHello", WellKnownObjectMode.SingleCall)
System.Console.WriteLine("Hit <enter> to exit...")
System.Console.ReadLine()
end sub
end class
end namespace
business logic
imports System
imports System.Runtime.Remoting
imports System.Runtime.Remoting.Channels
imports System.Runtime.Remoting.Channels.TCP
namespace RemotingSamples
public class HelloServer
inherits MarshalByRefObject
public sub HelloServer()
Console.WriteLine("HelloServer activated")
end sub
public function HelloMethod(name as String) as String
Console.WriteLine("Hello.HelloMethod : {0}", name)
Return String.Format("Hi there {0}", name)
end function
end class
end namespace
client
imports System
imports System.Runtime.Remoting
imports System.Runtime.Remoting.Channels
imports System.Runtime.Remoting.Channels.TCP
namespace RemotingSamples
public class Client
shared sub main
dim obj as HelloServer
Obj =
CType(Activator.GetObject(Type.GetType("RemotingSamples.HelloServer,
Object"), "tcp://localhost:8085/SayHello"), HelloServer)
if obj is nothing then
System.Console.WriteLine("Could not locate server")
else
Console.WriteLine(obj.HelloMethod("Caveman"))
end if
end sub
end class
end namespace