none
.NET REMOTING AND RUNTIME SERIALIZATION (SOAPFORMATTER UNABLE TO SERIALIZE GENERIC LIST) RRS feed

  • Question

  • Hi Folks

    i am currently working on windows Forms remoting application. the service is hosted on a remote server. My classes are marked as Serializable and the .NET runtime handles the Serialization.

    The Error am getting is : SOAPFORMATTER  IS UNABLE TO SERIALIZE GENERIC LIST.

    My question is that, why is the .NET RUNTIME using  SOAPFORMATTER  and not the BINARYFORMATTER.

    Any help would be appreciated. Thank You.

    Nick


    Nick

    Friday, September 9, 2016 8:15 AM

Answers

  • Hi Nick,

    >> My classes are marked as Serializable and the .NET runtime handles the Serialization.

    Did you develop with WCF?

    Based on your title, it seems you are using .net remoting. .NET remoting supports the use of generic types in distributed applications that use binary serialization. (SOAP serialization of generic type is not supported). It is recommended to use WCF.

    # Using Generic Types With .NET Framework Remoting

    https://msdn.microsoft.com/en-us/library/ms172342(v=VS.100).aspx

    If you insist on .net framework remoting, I think you need to use BinaryFormatter instead of SoapFormatter. Here is a simple code:

    var properties = new Dictionary<string, string>();
    
    properties["name"] = "HTTP Channel with a Binary Formatter";
    
    properties["priority"] = "15";
    
    properties["port"] = "8085";
    
    var sinkProvider = new BinaryServerFormatterSinkProvider();
    
    var httpChannel = new HttpServerChannel(properties, sinkProvider);
    

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Monday, September 12, 2016 2:29 AM