NotSerializable type used within remote method causes serialization exception

Why is it necessary to mark a type serializable, even if it's only used within a remote method. This type doesn't appear in the interface of the remote class, and I don't want do send this type via remoting. A call like in the example below causes a SerializationException.

example:

public void DoSomethingViaRemoting()

{

NotSerializableObject obj = new NotSerializableObject();

obj.DoSomething();

}

Is there any workaround to use not serializable types within a remote method?

[550 byte] By [TommyLeeJones] at [2007-12-26]

.NET Development

Site Classified