Reputation: 1080
I need to know if it is possible to have a .Net Remoting service that uses only the MarshalByValue scheme (just create an object on the server machine and pass it to the client using serialization).
If it is possible, how do I need to configure the application?
The reason I'm asking is that I need a very simple test application that does that (again, if it is possible), and all the examples I find seem to work with MarshalByRef objects.
Thanks!
Upvotes: 2
Views: 1124
Reputation: 6465
You can't create a remoting application that uses only MarshalByValue scheme. MarshalByValue is achieved through Serializable attribute and MarshalByRef is through inheritance to MarshalByRefObject. You can't control that in the config. See Joe's answer above that you cant exchange serialized MarshalByValue object unless you have a true remoteable object.
In the config, you can configure the server activation type which include SAO or CAO and with SAO you can further defined whether it is a Singleton or SingleCall well known type. Perhaps this is what you are referring to?
Upvotes: 2
Reputation: 124716
You need to have at least one MarshalByRef object to exchange the serialized MarshalByValue objects with the client.
Upvotes: 3