Remoting in .NET

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. מישהו יכול לעזור ?
 

עִנבל

New member
יש דרך ליישר

תשתמש בתגים [תחילת קוד] [סיום קוד] בתחתית מסך כתיבת ההודעה
blah​
 
מקווה שזה מיושר עכשיו !!

יש לי בעיה קטנה שאולי תוכלו לעזור לי איתה. אני פותח אפליקציית 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. מישהו יכול לעזור ?
 

Admini

New member
אני אעשה את זה כמו שצריך ../images/Emo13.gif

יש לי בעיה קטנה שאולי תוכלו לעזור לי איתה. אני פותח אפליקציית 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.​
מישהו יכול לעזור ? לא אני
 

sharkyM

New member
ניסיון לתשובה

הי למרות שעבודה עם remoting היא distributed, בכ"א אתה צריך שגם ה-server וגם ה-client יכירו את ה-type של ה-ro.
 
למעלה