Remoting in .NET
יש לי בעיה קטנה שאולי תוכלו לעזור לי איתה. אני פותח אפליקציית SERVER שעושה את הדבר הבא: Public Sub main() Dim tcpChannel As New TcpChannel(1099) ChannelServices.RegisterChannel(tcpChannel) Dim httpChannel As New HttpChannel(8888) ChannelServices.RegisterChannel(httpChannel) 'Register Server RemotingServices.Marshal(New RemoteObject, "RemoteObject") Console.WriteLine("Starting Server") Console.ReadLine() End Sub ומאפליקציית ה-CLIENT אני עושה כך: Private Sub InitTCP() Dim tcpChannel As TcpChannel = New TcpChannel ChannelServices.RegisterChannel(tcpChannel) Me.remote = Activator.GetObject(GetType(MyRemoting.RemoteObject), "tcp://127.0.0.1:1099/RemoteObject") End Sub לאובייקט RemoteObject ישנה מטודה אחת שמחזירה STRING מסויים. כל פעם שאני מנסה לפנות אליה אני מקבל את השגיאה הבאה: Run-time exception thrown : System.Runtime.Remoting.RemotingException - Cannot load type RemoteClient.MyRemoting.RemoteObject, RemoteClient, Version=1.0.1338.12290, Culture=neutral, PublicKeyToken=null. מישהו יכול לעזור ?
יש לי בעיה קטנה שאולי תוכלו לעזור לי איתה. אני פותח אפליקציית SERVER שעושה את הדבר הבא: Public Sub main() Dim tcpChannel As New TcpChannel(1099) ChannelServices.RegisterChannel(tcpChannel) Dim httpChannel As New HttpChannel(8888) ChannelServices.RegisterChannel(httpChannel) 'Register Server RemotingServices.Marshal(New RemoteObject, "RemoteObject") Console.WriteLine("Starting Server") Console.ReadLine() End Sub ומאפליקציית ה-CLIENT אני עושה כך: Private Sub InitTCP() Dim tcpChannel As TcpChannel = New TcpChannel ChannelServices.RegisterChannel(tcpChannel) Me.remote = Activator.GetObject(GetType(MyRemoting.RemoteObject), "tcp://127.0.0.1:1099/RemoteObject") End Sub לאובייקט RemoteObject ישנה מטודה אחת שמחזירה STRING מסויים. כל פעם שאני מנסה לפנות אליה אני מקבל את השגיאה הבאה: Run-time exception thrown : System.Runtime.Remoting.RemotingException - Cannot load type RemoteClient.MyRemoting.RemoteObject, RemoteClient, Version=1.0.1338.12290, Culture=neutral, PublicKeyToken=null. מישהו יכול לעזור ?