I am receiving a System.InvalidCastException with a
message of 'Return argument has an invalid type'
When running code from the client I can successfully
create an instance of Class1 on the server, however when I
make the method call GetClass2 I get the above error. I
want both of these to be CAO's because they have state
that pertains to the server machine. Is it possible for a
CAO to have a method that can return a reference to
another CAO that needs to be created by the first CAO? Am
I making any sense here?
Class1 : Inherits MarshalByRefObject
Public Function GetClassTwo() As Class2
Dim oRetVal As Class2 = New Class2()
Class2 : Inherits MarshalByRefObject