E
elziko
I'm trying to get my head around remotng and have created a class that can
accessed using remoting:
<RemotingService(WellKnownObjectMode.Singleton)> _
Public Class Customers
'tell .net that object will be created and kept on server, not moved to
the client
Inherits MarshalByRefObject
etc...
I can connect/instantiate the class from my client OK using:
Dim customers As Customers = CType(Activator.GetObject(GetType(Customers),
url), Customers)
but when I try to access a method like:
Dim customerID As Integer = Customers.CreateCustomer
I get the following exception:
"Attempted to create well-known object of type System.RuntimeType. Well
known objects must derive from the MarshalByRefObject class."
....which I find strange since my Customers class clearly inherits from
MarshalByRefObject!
Can anyone point me in the right direction to work out the problem?
[This is all taken from the sample in Ch20 of 'Professional VB.NET', 2nd Ed,
Wrox]
accessed using remoting:
<RemotingService(WellKnownObjectMode.Singleton)> _
Public Class Customers
'tell .net that object will be created and kept on server, not moved to
the client
Inherits MarshalByRefObject
etc...
I can connect/instantiate the class from my client OK using:
Dim customers As Customers = CType(Activator.GetObject(GetType(Customers),
url), Customers)
but when I try to access a method like:
Dim customerID As Integer = Customers.CreateCustomer
I get the following exception:
"Attempted to create well-known object of type System.RuntimeType. Well
known objects must derive from the MarshalByRefObject class."
....which I find strange since my Customers class clearly inherits from
MarshalByRefObject!
Can anyone point me in the right direction to work out the problem?
[This is all taken from the sample in Ch20 of 'Professional VB.NET', 2nd Ed,
Wrox]