I am developing a client-server application using .Net Remoting. From my server I want to return a List in response to a certain method call, however I get an exception saying that basically SoapFormatter cannot deal with generics. I need a workaround so that I am able to work with generics, or direction on how to use XmlSerializer or DataContractSerializer.
A:
That's cause they didn't add any additional support for the SoapFormatter and generics in .NET 2.0. A quick workaround would be to pass the List to the client as an array.
If you must use Generics (personally I'd consider upgrading this to WCF), there are some examples on how to do so in the MSDN remoting examples.
RichardOD
2009-11-01 17:01:19
I do not find this acceptable, since I intend to evolve the application so that the List<String> would turn into something else.
iulianchira
2009-11-01 17:03:02
OK- either consider WCF, or use the BinaryFormatter
RichardOD
2009-11-01 17:04:13